0

when using the following bash script to assign variable to the output of fuser, it still outputs the part of result(before :) of fuser to screen. why isn't it suppressed? I suspect it has to do with the ":" char output by fuser. how do I fix this?

test=`fuser -f /home/whois_database_collection_v4/whoisdatacollector/logs/com_log_2013_02_15_12_40_43.log`
/home/whois_database_collection_v4/whoisdatacollector/logs/com_log_2013_02_15_12_40_43.log:
user121196
  • 30,032
  • 57
  • 148
  • 198

1 Answers1

1

fuser sends the part of the output you see to stderr, and the rest to stdout (I suspect that it tries to simplify its usage from scripts, while preserving some beauty from the user's point of view). It will disappear if you add 2> /dev/null redirection for stderr.

Anton Kovalenko
  • 20,999
  • 2
  • 37
  • 69