Reputation: 4801
for ex :
grep -R "requests" /some/really/long/path/to/type/out
I would like to do something like this
grep -R "requests" (pwd)
Basically, using the output of pwd sorta like a pipe (pipe dosent do it).
Upvotes: 0
Views: 718
Reputation: 727
In bash you can use backtics for this:
grep -R "requests" `pwd`
pwd
will be executed and the stdout of pwd will be used as the third parameter of the grep command
Upvotes: 1
Reputation: 241898
Use command substitution:
grep -R "requests" $(pwd)
The output of the command in $(...)
is used as an argument list to the command. If you want the output to be treated as one word, wrap it in double quotes:
ls "$( command-that-produces-dirname-containing-whitespace )"
Upvotes: 4