Skip to main content

Questions tagged [shell-script]

Questions about shell scripts, executable files that are interpreted by a shell (bash, zsh, etc.). Check scripts with https://shellcheck.net before posting.

0 votes
0 answers
43 views

Hex memory dump is Docsis config file. Is it possible to convert this hex dump info valid Docsis config file? Preferably, using Perl and DOCSIS::ConfigFile module. (or Python scripts, python-docsis). ...
Lexx Luxx's user avatar
  • 1,473
0 votes
0 answers
36 views

Hi I was just wondering if this script looks ok I run it after I login thanks. #!/bin/bash echo "hi, starting wifi, nft and desktop" sudo ls sudo systemctl start wpaStart.service sudo nft -...
asker152's user avatar
  • 119
2 votes
1 answer
197 views

Just in theory: is it possible to replace the domain string in the compiled binary file with an IP address by editing a binary file in place with sed? (IP address belongs to a different domain, but ...
fxgreen's user avatar
  • 143
0 votes
1 answer
35 views

Here is a sample directory tree as it would appear if it were sorted in character code order (i.e., directories are not listed first): ${PREFIX}/ .bashrc .include.sh.d/ common.sh ...
Melab's user avatar
  • 4,458
11 votes
1 answer
1k views

The test [[ -n $1 ]] yields True if the length of string is non-zero. But I've seen elsewhere and have tried using just [[ $1 ]] without the primary -n and it seems to have the same effect. Is there ...
CertainPensioner's user avatar
1 vote
1 answer
68 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
94 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
0 votes
4 answers
64 views

I would like to mount a partition of an external hard drive from a script using udisksctl mount --block-device /dev/sda1 and in the end of the script I would like to unmount it. However, it may ...
Alexey's user avatar
  • 2,380
5 votes
1 answer
343 views

Why these commands lead to opposite comparison results between -ne and !=? Seems != works but -ne does not? I thought they are the same while comparing strings. % set -o | grep pipe pipefail ...
WesternGun's user avatar
1 vote
2 answers
56 views

I have the following script flow: The parent script is launched from a non-interactive shell and sources a child script. child launches a background subshell with (...) & and contains no code ...
Betonmischer's user avatar
0 votes
1 answer
64 views

#!/bin/bash DefaultColor="\033[0m" GREEN="\033[32m" RED="\033[31m" PURPLE="\033[35m" YELLOW="\033[33m" CYAN="\033[36m" CmdOk="\033[...
Maxime's user avatar
  • 3
0 votes
0 answers
34 views

What do I want : On the file manager lf, we can bind some keyboard shortcuts to do either a lf command with :, or a shell command with $, !, or other symbols. According to the documentation, there is ...
ewen-goisot's user avatar
5 votes
1 answer
373 views

Common method for preventing concurrent runs for a given script is utilizing flock as: LOCK=/var/lock/my-lock exec 9>>"$LOCK" if ! flock --exclusive --nonblock 9; then echo "...
basher's user avatar
  • 71
0 votes
0 answers
50 views

I am trying to implement a shell(zsh) based Pomodoro clock and I encountered a problem: sending -STOP signal to background sleep process does not stop it. WesternGun@MyMacBook-Pro:~ [12:13:49] 0 % ...
WesternGun's user avatar
1 vote
1 answer
56 views

I am writing a bash script and I am aware that I can get information of the mounts attached to a container using docker inspect --format '{{.Mounts}}' <container-name> which gives a result such ...
neildeadman's user avatar

15 30 50 per page
1
2 3 4 5
1120