Reputation: 305
I have a script that (in turn) calls a command line program. It would vastly simplify my life if there was a way that it could accept a command of the form
psfcheck.py -n file*.img
in a way such that within the program I could then use the term "file*.img" as a string, since there are a few times I want to pass such a string through other command line programs which need to be run on the batch of files as a group (not individually, one at a time).
Is this possible? It feels like a n00bish question, but I've been pythoning for a while and have never stumbled across this.
Upvotes: 2
Views: 1348
Reputation: 2182
The shell will expand any wildcards that it finds. You can prevent this by putting them inside quotes to hide them from the shell:
psfcheck.py -n "file*.img"
Upvotes: 1
Reputation: 114921
Put quotes around the argument:
psfcheck.py -n "file*.img"
That will prevent the shell from expanding the pattern into the list of matching files.
Upvotes: 2