Can I execute command within another command in UNIX shells?
If impossible, can I use the output of the previous command as the input of next command, as in:
command x
then command y
,
where in command y
I want use the output of command x
?
You can use the backquotes for this.
For example this will cat the file.txt
cat &graveecho file.txt&grave
And this will print the date
echo the date is &gravedate&grave
The code between back-quotes will be executed and be replaced by its result.