Jan 29, 2007 #1 hokky Technical User Nov 9, 2006 170 AU Hi guys, Just wondering how to diff between two variable example: Code: a=`ls dir1` b=`ls dir2` diff $a $b --> wont work Do you know how to do that ? or diff only work for files only ?
Hi guys, Just wondering how to diff between two variable example: Code: a=`ls dir1` b=`ls dir2` diff $a $b --> wont work Do you know how to do that ? or diff only work for files only ?
Jan 29, 2007 #2 p5wizard IS-IT--Management Apr 18, 2005 3,165 BE Yes - only for files, so: ls dir1 >/tmp/lsdir1$$ ls dir2 >/tmp/lsdir2$$ diff /tmp/lsdir1$$ /tmp/lsdir2$$ rm /tmp/lsdir1$$ rm /tmp/lsdir2$$ (the $$ adds the current process' PID to the filenames, so the files are unique enough) HTH, p5wizard Upvote 0 Downvote
Yes - only for files, so: ls dir1 >/tmp/lsdir1$$ ls dir2 >/tmp/lsdir2$$ diff /tmp/lsdir1$$ /tmp/lsdir2$$ rm /tmp/lsdir1$$ rm /tmp/lsdir2$$ (the $$ adds the current process' PID to the filenames, so the files are unique enough) HTH, p5wizard
Jan 30, 2007 #3 columb IS-IT--Management Feb 5, 2004 1,231 EU On most versions of Unix you can simply do Code: diff dir1 dir2 Tested on RedHat Linux and AIX 4.3 Ceci n'est pas une signature Columb Healy Upvote 0 Downvote
On most versions of Unix you can simply do Code: diff dir1 dir2 Tested on RedHat Linux and AIX 4.3 Ceci n'est pas une signature Columb Healy