linux - diff commnad not working "missing operand after `diff'" -


in diff command getting following error. kindly assist how can specify want see difference in 2 files:

#current_unavail=ranjith  root@iitmserver1 tmp]# cat /tmp/ran ranjith [root@iitmserver1 tmp]#  #test=$(cat /tmp/ran)  [root@iitmserver1 tmp]# diff `$current_unavail` `$test` diff: missing operand after `diff' diff: try `diff --help' more information. [root@iitmserver1 tmp]# 

diff takes 2 filenames arguments, appear passing in file contents first argument. want change script/commands more like:

current_unavail=/tmp/unavail_cn.out result=$(diff $current_unavail /moes/home/pharthiphan/scripts/monitoring/unavail_cn/$last_unavail) 

alternatively, can use process substitution pass output of command command expecting file. eg:

diff <(echo -e "foo\nbar") <(echo -e "foo\nbaz") 

however, while know about, seem needless level of complexity current problem.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -