Viewing 1 to 2 of 2 items
Tag Archives: Foo

unix shell script find out which directory the script file resides?

For bash, sh, ksh: #!/bin/bash # Absolute path to this script, e.g. /home/user/bin/foo.sh SCRIPT=$(readlink -f $0) # Absolute path this script is in, thus /home/user/bin SCRIPTPATH=$(dirname $SCRIPT) echo $SCRIPTPATH For tcsh, csh: #!/bin/tcsh # Absolute path to this script, e.g. /home/user/bin/foo.csh set SCRIPT=`readlink -f $0` # Absolute path this script is in, thus /home/user/bin set  Full Article…

0

Merge 2 csv files with awk

I have 2 files pipe delimted and want to merge them based on a key e.g file 1 Code: 123$aaa$yyy$zzz 345$xab$yzy$zyz 456$sss$ttt$foo 799$aaa$ggg$dee file 2 Code: 123$hhh 345$ddd 456$xxx 888$zzz so if the key is the first field, and the result should be the common key between file 1 and 2 i.e. result will be  Full Article…

0