New answers tagged

0

I take it you're going to have a lot of stepN and varN files? I would use for grep's -f option and the -n as you have. grep -n -f var4 step4 That outputs: mdiehn@frank ~ $ grep !* grep -n -f var4 step4 1:tstart [s]: 1.50E+1 4:1.50E+1,4.26E-1,... If you don't want tstart, either eliminate it with 'grep -v' or we could get into some more interesting awk ...


0

Aliases don't take arguments. Use a function instead: searchword () { ssh -t user@server "grep -i '$1' /root/file.txt" } Note that it is dangerous, it can lead to uncontrolled code execution. Imagine what happens then the argument is '; rm -rf / ; #


Top 50 recent answers are included