Skip to main content

Questions tagged [parameter]

0 votes
1 answer
59 views

Can we pass directory list from find command as argument to another find command and execute md5sum?

I want to list all the directories in present directory and pass those directories as a argument to another find command The below example will explain it correctly. $ find . -maxdepth 1 -type d . ./...
user27072144's user avatar
3 votes
1 answer
257 views

Convention of parameter naming - undocumented options

GNU has long pushed for a combination of short options (-h) and long options (--help), which goes a long way to clearing up the syntactical mess of commands like tar and dd, with their legacy syntax ...
Popup's user avatar
  • 714
0 votes
1 answer
98 views

What do (G) and (S) mean in samba's parameter configuration?

In the official documentation of Samba, the smb.conf(5) page has an "Explanation Of Each Parameter" section. For some parameters, two possible values (either (G) or (S)) are shown at the end ...
Manuel Jordan's user avatar
0 votes
1 answer
152 views

how to configure sudo to allow certain parameter

In particular I want to allow the following command without password: sudo cfgutil --ecid "${Device_ECID}" install-application "${in_File_Name}" With Device_ECID and in_File_Name ...
Martin's user avatar
  • 113
1 vote
1 answer
439 views

Bash parameter substitution with multi line error message

I'm using parameter substitution with an error message, such as ${var1:?'some message'}. I've incorporated a multi-line error message. Presently, it only functions properly when enclosed within single ...
programmer Erfan's user avatar
2 votes
2 answers
378 views

Parameter expansion of variable containing control characters

I'm looking to replace the group separator control character, which is printed by the terminal as "^]" and has got octal code of: 035, with a space. This can simply be done using tr, like so:...
Maikol's user avatar
  • 164
0 votes
4 answers
285 views

How can I use parameter expansion together with command substitution?

I want to create 12 directories named after the months. So I tried using locale to get the month names, piping to tr to separate them with commas, then put braces around and passed to mkdir. But ...
teraspora's user avatar
  • 111
1 vote
1 answer
2k views

Can I configure parameters when launching flatpak apps from the GUI?

One of my Flatpak application stopped working properly, probably after a silent upgrade. I found a fix online that tells me to add a parameter. That fix works. Nonetheless, I like running that app ...
SteeveDroz's user avatar
0 votes
0 answers
102 views

Issue regarding flames game in shell script

I am trying to make a flames game in shell script. I take 2 names and sort names. My code like this: var=$(j=1;for((i=0;i<${#name1Low};i++));do echo "${name1Low:i:j}";done |sort|tr -d '\n'...
utkarsh dubey's user avatar
1 vote
1 answer
610 views

Splitting parameter list

I want to create a bash function that will accept variable number of parameters. There must be at least one parameter. Then I call another program and need to insert fixed values between the first ...
Ivan Onyshchenko's user avatar
4 votes
2 answers
479 views

Is it possible to apply substring expansion to all elements of a zsh array?

Let's say I'd like to remove the first two and last three characters from all elements of an array e.g. results=( QK9H9UtADCgnG AlaLkCADjQ krsxseW8H1VrU 6nBG94ZbCWQ ) I'd like to end up with results=(...
don_crissti's user avatar
  • 85.6k
7 votes
3 answers
700 views

Is it possible to print a command so that the output can be parsed to create the same command?

The question may sound quite complicated, but in fact it is not! Consider: % f() { echo "$@"; } % f a a % f cmd -o"value with space" cmd -ovalue with space % f cmd -ovalue with ...
U. Windl's user avatar
  • 1,771
7 votes
3 answers
1k views

Remove repeating string pattern from variable with POSIX parameter expansion

I wanted to use 2.6.2 Parameter Expansion to remove leading characters from a string, but was surprised to find out that "Remove Largest Prefix Pattern" doesn't automatically repeat the ...
finefoot's user avatar
  • 3,554
3 votes
2 answers
996 views

Bash Parameter Expansion - Get Variables with a Prefix while Escaping Hyphen

EDIT: I realized I was mistaken about a central assumption in this post: The ${!prefix@} syntax isn't able to get function names, but only variables. Therefore, there is no way to get ${!prefix@} to ...
Q Z's user avatar
  • 133
1 vote
1 answer
5k views

Replace $placeholder text in various configuration files with $placeholder parameter

I am at my wits end trying to get sed to do this for me and I feel like an idiot. So I hope someone has a much smarter way to accomplish what seems to be incredibly simple. file.conf: USER: !USER! ...
cmjordan's user avatar

15 30 50 per page
1
2 3 4 5
15