Tagged Questions
21
votes
7answers
2k views
why does ls -d also list files, and where is it documented?
when specifying ls --directory a* it should list only directories starting with a*
BUT it lists files AND directories starting with a
Questions:
where might I find some documentation on this, ...
1
vote
0answers
140 views
Processing shell script options with awk
I'm looking for way to process shell script arguments that is cleaner and more "self documenting" than getopt/getopts.
It would need to provide...
Full support of long options with or without a ...
6
votes
3answers
336 views
getopt, getopts or manual parsing - what to use when I want to support both short and long options?
Currently I'm writing a Bash script which has the following requirements:
it should run on a wide variety of Unix/Linux platforms
it should support both short and (GNU) long options
I know that ...
5
votes
1answer
207 views
In the usage string of my custom shell script, shall I also display --help and --version?
I'm currently developing a shell script, called up, which shows a usage string on the commandline when called with --help. The output looks like this:
$ up --help
usage: up [-n ...
3
votes
2answers
667 views
How can I detect that no options were passed with getopts?
I have this code -
#getoptDemo.sh
usage()
{
echo "usage: <command> options:<w|l|h>"
}
while getopts wlh: option
do
case $option in
(w)
name='1';;
...
1
vote
1answer
119 views
What is the canonical way to implement order independent options in bash scripts? [duplicate]
Possible Duplicate:
How do I handle switches in a shell script?
Most common shell commands allow the user to specify options in any random order. Positional Parameters like $1 as commonly ...
4
votes
3answers
501 views
Remove many many many files from a folder
I have a folder with 137795 files in it. I need to delete all of them. When I run rm * I get -bash: /bin/rm: Argument list too long. How do I get past this error?
