I want to fill a variable with a commnad line read from a file and execute it. No problem when it is a single command. When I use a |, it doesnt work. Any help ???Thank you $ f=ls -1$ $faa0a1a2a3b1cfgcfiledfileefcorreo.txtloglogswork$ f=ls -1 | tail -1$ $fls: cannot access |: No such file or directoryls: cannot access tail: No such file or directory$ f='ls -1 | tail -1'$ $fls: cannot access |: No such file or directoryls: cannot access tail: No such file or directory$ echo $fls -1 | tail -1
a command inside a variable
ksh
you can use a function as below;f() { ls -1 | tail -1; } Eg;user@host $ f() { ls -1 | tail -1; }user@host $ ftest.txt