Skip to main content

Questions tagged [options]

Passing options like -l or --word to commands, or parsing them in scripts.

1 vote
1 answer
94 views

Suppose we have the file ./testing with contents #!/bin/bash # Flags # Source: https://stackoverflow.com/a/7948533/31298396 TEMP=$(getopt -o ''\ --long first,second \ -...
Grass's user avatar
  • 145
2 votes
1 answer
111 views

Using https://stackoverflow.com/a/7948533/31298396, we can implement flags for a script testing as follows: #!/bin/bash # Flags # Source: https://stackoverflow.com/a/7948533/31298396 TEMP=$(getopt ...
Grass's user avatar
  • 145
1 vote
1 answer
423 views

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 ...
Tim's user avatar
  • 113
0 votes
2 answers
187 views

I would like to pass long arguments to script, and referred this link. I created this my_script: #!/usr/bin/env bash # # Adapted from https://www.shellscript.sh/examples/getopt/ # set -euo pipefail ...
SheCodes's user avatar
  • 103
1 vote
4 answers
224 views

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 ...
hollowillow's user avatar
5 votes
4 answers
994 views

I'm trying to build a wrapper to execute a tool multiple times, then concatenate some of the results. I'd like to pass two sets of files to my wrapper script, then run the tool for each pair of files. ...
Whitehot's user avatar
  • 245
1 vote
2 answers
108 views

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 ...
Kiki Miki's user avatar
4 votes
2 answers
846 views

In almost all POSIX specifications (e.g. ls), there are only short options (e.g. -A , -a , etc). In common shells like Bash, long options (e.g. --all , --almost-all , etc) are very common. And it is ...
midnite's user avatar
  • 613
0 votes
1 answer
113 views

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 ...
Andrés's user avatar
0 votes
1 answer
231 views

Already in the 1980ies, ls -l did mostly what it does today. For a boolean option, in this case l, I hardly ever questioned why it is prefixed with a dash: without an indicator, ls l would mean "...
Harald's user avatar
  • 1,050
11 votes
1 answer
3k views

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 ...
Kamil Maciorowski's user avatar
0 votes
0 answers
84 views

Inspired by What is the difference between “base64 -b0” in macOS versions prior to macOS 13 (Ventura) and “base64 -i” in macOS 13 (Ventura)? Are there common ways to avoid the script breaking on a ...
typo's user avatar
  • 249
0 votes
1 answer
91 views

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 "--...
Nor.Z's user avatar
  • 133
1 vote
1 answer
552 views

The manpage for objdump states: --demangle[=style] ... The optional demangling style argument can be used to choose an appropriate demangling style for your compiler. Nowhere does it mention ...
Byron Hawkins's user avatar
1 vote
1 answer
130 views

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 ...
Husky2490's user avatar

15 30 50 per page
1
2 3 4 5
24