<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic diff command without show differences ... in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/diff-command-without-show-differences/m-p/3701664#M103341</link>
    <description>Hi .. &lt;BR /&gt;i'm making a script where i'm working with diff sentece, how can i make to not show diferences if there are?&lt;BR /&gt;i tryed to send with 2/dev/null but is not working?&lt;BR /&gt;&lt;BR /&gt;NOW and LAST are files:&lt;BR /&gt;&lt;BR /&gt;$ diff NOW LAST 2&amp;gt;/dev/null&lt;BR /&gt;1c1&lt;BR /&gt;&amp;lt; UUvxfsd root&lt;BR /&gt;---&lt;BR /&gt;&amp;gt; vxfsd root&lt;BR /&gt;Is different&lt;BR /&gt;&lt;BR /&gt;i'd like appears how it looks like next withow diferences ...&lt;BR /&gt;$ diff NOW LAST 2&amp;gt;/dev/null&lt;BR /&gt;is different&lt;BR /&gt;&lt;BR /&gt;how can i do it ?&lt;BR /&gt;&lt;BR /&gt;Manuales.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 03 Jan 2006 13:14:10 GMT</pubDate>
    <dc:creator>Manuales</dc:creator>
    <dc:date>2006-01-03T13:14:10Z</dc:date>
    <item>
      <title>diff command without show differences ...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/diff-command-without-show-differences/m-p/3701664#M103341</link>
      <description>Hi .. &lt;BR /&gt;i'm making a script where i'm working with diff sentece, how can i make to not show diferences if there are?&lt;BR /&gt;i tryed to send with 2/dev/null but is not working?&lt;BR /&gt;&lt;BR /&gt;NOW and LAST are files:&lt;BR /&gt;&lt;BR /&gt;$ diff NOW LAST 2&amp;gt;/dev/null&lt;BR /&gt;1c1&lt;BR /&gt;&amp;lt; UUvxfsd root&lt;BR /&gt;---&lt;BR /&gt;&amp;gt; vxfsd root&lt;BR /&gt;Is different&lt;BR /&gt;&lt;BR /&gt;i'd like appears how it looks like next withow diferences ...&lt;BR /&gt;$ diff NOW LAST 2&amp;gt;/dev/null&lt;BR /&gt;is different&lt;BR /&gt;&lt;BR /&gt;how can i do it ?&lt;BR /&gt;&lt;BR /&gt;Manuales.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Jan 2006 13:14:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/diff-command-without-show-differences/m-p/3701664#M103341</guid>
      <dc:creator>Manuales</dc:creator>
      <dc:date>2006-01-03T13:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: diff command without show differences ...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/diff-command-without-show-differences/m-p/3701665#M103342</link>
      <description>Hi Manuales:&lt;BR /&gt;&lt;BR /&gt;Then do:&lt;BR /&gt;&lt;BR /&gt;# diff NOW LAST &amp;gt; /dev/null || echo "are different!"&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 03 Jan 2006 13:19:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/diff-command-without-show-differences/m-p/3701665#M103342</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-01-03T13:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: diff command without show differences ...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/diff-command-without-show-differences/m-p/3701666#M103343</link>
      <description>Hi James !!!&lt;BR /&gt;i tryied with 1&amp;gt;/dev/null instead of 2/dev/null and worked  !!!&lt;BR /&gt;&lt;BR /&gt;:D  :D :D  :D  :D&lt;BR /&gt;&lt;BR /&gt;thanks !!!</description>
      <pubDate>Tue, 03 Jan 2006 13:24:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/diff-command-without-show-differences/m-p/3701666#M103343</guid>
      <dc:creator>Manuales</dc:creator>
      <dc:date>2006-01-03T13:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: diff command without show differences ...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/diff-command-without-show-differences/m-p/3701667#M103344</link>
      <description>Instead of "diff", use "cmp -s". This will work faster and less resources.&lt;BR /&gt; &lt;BR /&gt;Example-&lt;BR /&gt;if cmp -s NOW LAST ; then&lt;BR /&gt;echo files are same&lt;BR /&gt;else&lt;BR /&gt;echo files are different&lt;BR /&gt;fi&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;Rod Hills</description>
      <pubDate>Tue, 03 Jan 2006 13:34:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/diff-command-without-show-differences/m-p/3701667#M103344</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2006-01-03T13:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: diff command without show differences ...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/diff-command-without-show-differences/m-p/3701668#M103345</link>
      <description>Hi (again) Manuales:&lt;BR /&gt;&lt;BR /&gt;We could amend things thusly, too:&lt;BR /&gt;&lt;BR /&gt;# diff NOW LAST &amp;gt; /dev/null &amp;amp;&amp;amp; echo "are same" || echo "are different"&lt;BR /&gt;&lt;BR /&gt;# cmp -s &amp;gt; /dev/null &amp;amp;&amp;amp; echo "are same" || echo "are different"&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 03 Jan 2006 13:42:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/diff-command-without-show-differences/m-p/3701668#M103345</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-01-03T13:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: diff command without show differences ...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/diff-command-without-show-differences/m-p/3701669#M103346</link>
      <description>Hi James and Rodni (and another too ...)&lt;BR /&gt;&lt;BR /&gt;i know that diff with if only work with files :&lt;BR /&gt;"if diff NOW LAST&lt;BR /&gt;then ..."&lt;BR /&gt;but, how can i compare strings instead of files?&lt;BR /&gt;&lt;BR /&gt;this is because in my script i'm redirecting string to a file, and for to make more short my script, how can i compare strings??&lt;BR /&gt;&lt;BR /&gt;tempo2 file contains: process (ps -fea and user process, check only there are two fields separated by an space) tempo2 file was generated from a function and is a file:&lt;BR /&gt;&lt;BR /&gt;.......................&lt;BR /&gt;.......................&lt;BR /&gt;.......................&lt;BR /&gt;/etc/opt/resmon/lbin/p_client root&lt;BR /&gt;/etc/opt/resmon/lbin/registrar root&lt;BR /&gt;/opt/dce/sbin/rpcd root&lt;BR /&gt;/opt/egb/lbin/egcd root&lt;BR /&gt;/opt/hpnp/bin/hpnpd root&lt;BR /&gt;/opt/itadm/it_sw/bin/itappssv -si00 -snsiddp -dbITP -t1 itadm&lt;BR /&gt;......&lt;BR /&gt;.......&lt;BR /&gt;.......&lt;BR /&gt;&lt;BR /&gt;next function of script is a function wich verify how much processes are running with same name and then put the name of the user:&lt;BR /&gt;NOW=ACTUAL  (ACTUAL in spanish is like now in english)&lt;BR /&gt;LAST=ULTIMO (ULTIMO in spanish is like last in english)&lt;BR /&gt;&lt;BR /&gt;function obtiene_total&lt;BR /&gt;{&lt;BR /&gt;typeset -i x=0 totalproc=0&lt;BR /&gt;while read actual&lt;BR /&gt;do&lt;BR /&gt; if [ "$x" = 0 ] &lt;BR /&gt; then&lt;BR /&gt; echo $actual &amp;gt; ULTIMO&lt;BR /&gt; else&lt;BR /&gt;            ultimo=`tail -1 ULTIMO`&lt;BR /&gt;            echo $actual &amp;gt; ACTUAL&lt;BR /&gt;        if diff ULTIMO ACTUAL 1&amp;gt;/dev/null&lt;BR /&gt;     then&lt;BR /&gt;                 let " totalproc = $totalproc + 1 "&lt;BR /&gt;                 band=igual &lt;BR /&gt;            else&lt;BR /&gt;                 case $band in&lt;BR /&gt;                 igual) echo $totalproc $ultimo &amp;gt;&amp;gt; procesos.txt&lt;BR /&gt;                        band=salta ;;&lt;BR /&gt;                 esac&lt;BR /&gt;                 typeset -i totalproc=0&lt;BR /&gt;                 case $band in&lt;BR /&gt;                 diferents) let " totalproc = $totalproc + 1 " &lt;BR /&gt;                        echo $totalproc $ultimo &amp;gt;&amp;gt; procesos.txt ;;&lt;BR /&gt;   esac&lt;BR /&gt;                 band=diferents &lt;BR /&gt;             fi&lt;BR /&gt; fi&lt;BR /&gt;        echo $actual &amp;gt; ULTIMO&lt;BR /&gt; let " x = x + 1 " &lt;BR /&gt;done &amp;lt; tempo2&lt;BR /&gt;rm ACTUAL ULTIMO&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;The result will be:&lt;BR /&gt;..........&lt;BR /&gt;..........&lt;BR /&gt;16 /usr/sbin/biod 16 root&lt;BR /&gt;1 /usr/sbin/biod 16 root&lt;BR /&gt;1 /usr/sbin/cron root&lt;BR /&gt;1 /usr/sbin/envd root&lt;BR /&gt;1 /usr/sbin/getty console console root&lt;BR /&gt;1 /usr/sbin/guardAgntd root&lt;BR /&gt;1 /usr/sbin/hp_unixagt root&lt;BR /&gt;1 /usr/sbin/inetd root&lt;BR /&gt;1 /usr/sbin/lpsched lp&lt;BR /&gt;1 /usr/sbin/mib2agt root&lt;BR /&gt;1 /usr/sbin/netfmt -C -F -f /var/adm/nettl.LOG00 -c /var/adm/c root&lt;BR /&gt;20 /usr/sbin/nfsd 20 root&lt;BR /&gt;1 /usr/sbin/nfsd 20 root&lt;BR /&gt;1 /usr/sbin/ptydaemon root&lt;BR /&gt;1 /usr/sbin/pwgrd root&lt;BR /&gt;...................&lt;BR /&gt;...................&lt;BR /&gt;...................&lt;BR /&gt;...................&lt;BR /&gt;&lt;BR /&gt;first field is number of same process and second field is the name of the process.&lt;BR /&gt;&lt;BR /&gt;well question is:&lt;BR /&gt;how can i compare strings with diff and cpm?&lt;BR /&gt;&lt;BR /&gt;Thanks !!!&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Jan 2006 14:01:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/diff-command-without-show-differences/m-p/3701669#M103346</guid>
      <dc:creator>Manuales</dc:creator>
      <dc:date>2006-01-03T14:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: diff command without show differences ...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/diff-command-without-show-differences/m-p/3701670#M103347</link>
      <description>Hi Manuales:&lt;BR /&gt;&lt;BR /&gt;Since you are dealing with ASCII data, redirect your output to a file and, again, use 'diff' but this time add some other options to ignore trailing blanks ('-b'); ignore whitespace and tabs during equality checking ('-w'); and ignore upper/lowercase differences ('-i'):&lt;BR /&gt;&lt;BR /&gt;# diff -bwi file1 file2 &lt;BR /&gt;&lt;BR /&gt;By the way, I should have written:&lt;BR /&gt;&lt;BR /&gt;# cmp -s NOW LAST &amp;amp;&amp;amp; echo "are same" || echo "are different"&lt;BR /&gt;&lt;BR /&gt;...in my last post.  The '-s' of 'cmp' as Rodney used is designed for "silence" --- no output; hence no need to redirect anything to '/dev/null'/&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 03 Jan 2006 14:11:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/diff-command-without-show-differences/m-p/3701670#M103347</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-01-03T14:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: diff command without show differences ...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/diff-command-without-show-differences/m-p/3701671#M103348</link>
      <description>Manuales&lt;BR /&gt;&lt;BR /&gt;Does this give the desired result:&lt;BR /&gt;&lt;BR /&gt; UNIX95= ps -A -oargs=  -ouser= | sort | uniq -c | pg</description>
      <pubDate>Tue, 03 Jan 2006 14:44:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/diff-command-without-show-differences/m-p/3701671#M103348</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2006-01-03T14:44:33Z</dc:date>
    </item>
  </channel>
</rss>

