Showing posts with label shell/bash scripting. Show all posts
Showing posts with label shell/bash scripting. Show all posts

Sunday, July 20, 2014

some imp commands to be edited later..


 perl -pi -e 's/batchSIFTflow1/batchSIFTflowUsingDecaf/g' myBatchSIFTFLowDecaf*.m
 grep  batchSIFTflowUsingDecaf myBatchSIFTFLowDeca*.m
 perl -pi -e 's/gistL2/DecafL2/g' myBatchSIFTFLowDecaf*.m
 diff myBatchSIFTflow16.m myBatchSIFTFLowDecaf16.m
 sed 's/flow1/flowUsingDecaf/g' myBatchSIFTflow16.m | sed 's/,1,/,20,/g' | sed 's/gistL2/DecafL2/g' > tmp
 diff myBatchSIFTflow16.m tmp
 for i in {1..47}; do sed 's/flow1/flowUsingDecaf/g' myBatchSIFTflow$i.m | sed 's/,1,/,20,/g' | sed 's/gistL2/DecafL2/g' > myBatchSIFTFLowDecaf$i.m; done

adding numbers is a bash script

num=$[num1+num2]
there are many more options, but this is the simplest.
Note no spaces between any of the characters above

Saturday, March 15, 2014

some printing formats..

for i in {0..10};do printf "%02d\n" $i; done

for i in {000..100};do echo $i; done