This question is loosely related to this post. The basic idea is that OP had - in filename which broke ls *.vcf. What happened is clearly understood, but the question is then, how could one 'protect' or anticipate such filenames with the wildcard expansion ? I know one could use find , but what about wildcard expansion in shell specifically ?
Asked
Active
Viewed 46 times
0
Sergiy Kolodyazhnyy
- 16,187
- 11
- 53
- 104
-
@don_crissti well . . . that was so obvious that I just feel stupid. Write an answer. – Sergiy Kolodyazhnyy May 10 '17 at 18:39
-
or `ls -- ...` ... – Jeff Schaller May 10 '17 at 18:42
-
`ls -- *.vcf`. `--` is an argument which is available in many commands which is understood to mean "no more switches starting with `-` from this point". – DopeGhoti May 10 '17 at 18:43
-
@JeffSchaller that's not 100% reliable, not all commands have that option. But yeah . . .it's a dupe of what don_crissti linked. Just VTC – Sergiy Kolodyazhnyy May 10 '17 at 18:43