I'm trying to use the output of a command as arguments:
The command: /home/alexandre/dropbox.py exclude add ls | grep -v photos
I have to add a list of files, for example:
/home/alexandre/dropbox.py exclude add a.txt b.txt c.txt
ls | grep -v photos
will give me a list of all files except the folder photos
.
But if I use my command, the command adds exclusion for the file ls
(which does not exist, I want to run the command ls
).
Anybody know how to do that?
What you are looking for is to execute the command in a subshell, like:
/home/alexandre/dropbox.py exclude add $(ls | grep -v photos)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments