How to execute an output string without bash's command substitution?
For example, if I type in terminal
tshark, and the program isn't installed yet, I will recieve an error message like:
_some text_ sudo apt-get install tshark
Now I want to execute this last line without copy&paste or transcription.
If I try
$ tshark 2> >(tail -1) sudo apt-get install tshark
I will get this last line I want to execute.
And if I want to execute this string, of course bash's command substitution works and install everything properly:
$ $(tshark 2> >(tail -1))
But if I don't use bash's command substitution, and pipe this to xargs like
$ tshark 2> >(tail -1) | xargs sudo apt-get install tshark
I am wondering why piping to xargs seems to have no effect.
But if I try
$ tshark 2> >(tail -1) | xargs xargs
sudo prompt's me correct for password, and than
apt-get abbort's after Y/N for installing or not.
The same result occurs if I pipe to
Any response or hint is welcome.