Hey all,
Please read through the entire problem before answering. Thanks.
I know that Linux allows you to redirect the standard output of a command to the standard input of another command using the pipe function (letter '|').
But what I want to do is use the standard output of a command as a COMMAND-LINE ARGUMENT of the other command.
Example:
locate abc.txt gives me this:
Code:
$ locate abc.txt
/home/madiyaan/dir1/dir2/dir3/abc.txt
Now I want to be able to use this as the command line argument (as opposed to, say, copy and pasting) of another command like cat.
Code:
$ cat some_stuff_goes_here_for_redirection locate abc.txt
This will save me a lot of copy and pasting. Please tell me a way to do this in just one line.
Thanks,
Madiyaan