Questions tagged [options]
Passing options like -l or --word to commands, or parsing them in scripts.
348 questions
1 vote
1 answer
69 views
Bash: only the first long option is being processed
Suppose we have the file ./testing with contents #!/bin/bash # Flags # Source: https://stackoverflow.com/a/7948533/31298396 TEMP=$(getopt -o ''\ --long first,second \ -...
1 vote
1 answer
341 views
Shell script with getopt for short and long options -handling option with and without argument
Wanted to run a script -- with option ./myscript.sh -a -g test -- without option ./myscript.sh -a -g The script looks like in below snippet, but don't see below script working correctly. The getopt ...
1 vote
4 answers
201 views
Need shell script help - processing the same option multiple times
So I've ran into a bit of a wall, I have an option in my script that calls a function which allows me to specify a file/directory and then I want to parse that output into a menu tool (using dmenu in ...
1 vote
2 answers
92 views
The ambiguous principles that guide the lsblk utility in removing duplicates of displayed records
Linux Mint 20.3 lsblk -V lsblk from util-linux 2.34 Let's find an explanation for the ambiguous behavior of the lsblk utility applied with the -E option. Here is the output without applying the -E ...
0 votes
1 answer
98 views
zsh auto completion of cp options doesn't list all of them
I've been working on setting my autocmp following this guide https://thevaluable.dev/zsh-install-configure-mouseless/. I'm on a MacOS environment but for some reason when I try to autocomplete options ...
11 votes
1 answer
3k views
Why does `nice` with a negative argument (e.g. `nice -15`) increment niceness?
My nice is from GNU coreutils 9.1. I observed that nice -15 is equivalent to nice -n 15: nice # prints 0 for me, the base niceness is 0 nice -n 15 nice # prints 15, this is ...
0 votes
1 answer
72 views
What is the difference between quotes wrap around only the option value vs quotes wrap around the option name and option value?
What is the difference between quotes wrap around only the option value eg: grep --file="grep pattern file.txt" * vs quotes wrap around the option name and option value eg: grep "--...
1 vote
1 answer
115 views
Could someone explain when I would use sync -d over sync with no options?
I'm looking at an online man page for the sync command and I can't quite figure out the intended use of the -d or --data option. Is it faster? Does it have any noticeable effect? Or is it something ...