I have the following situation:
$ ls
0.txt aaa.txt a-.txt a.txt b.txt ddd.txt -hello.txt libs -.txt ,.txt !.txt ].txt \.txt
$ ls [-a]*.txt
ls: opzione non valida -- "e"
Try 'ls --help' for more information.
$ ls [a-]*.txt
ls: opzione non valida -- "e"
Try 'ls --help' for more information.
The dash (-
) creates some problems. How can I find a file starting with -
?
--
is portable. – Gilles 'SO- stop being evil' Oct 01 '16 at 23:50-
" question I can flag this as a duplicate of? It seems like we have had one of these questions every week for a while – cat Oct 02 '16 at 01:39something ./*
on the command line, to properly designate the files we want to affect, andsomecommand [options here] -- "$@"
in our function definitions, where -- clearly delimitate options from args – Olivier Dulac Oct 03 '16 at 15:52