Skip to main content

Questions tagged [bash-scripting]

Bash scripting is making scripts in the Bash shell language.

3 votes
2 answers
138 views

I have a polling script that will occasionally pop out the name of a file to delete. The file to delete will always be located on an NFS-mounted filesystem. So I wrote this Bash script: #!/bin/bash /...
Richard Lawson's user avatar
7 votes
3 answers
652 views

I have a lot of code with lines like the following: local -r foo="$(bar)" Just recently I discovered shellcheck and that warns about those assignments, because local hides the actual error ...
Thorsten Schöning's user avatar
0 votes
0 answers
78 views

I have a script like this listed on the device: { "type": "SCRIPT", "id": 67, "name": "script.run_application", "language&...
Bedrettin Tozlu's user avatar
2 votes
1 answer
139 views

I'd like to automate logging out and suspending the PC on Ubuntu 24 with LightDM. I tried this: SESSION_ID=$(loginctl | grep $(whoami) | awk '{print $1}') loginctl terminate-session "$SESSION_ID&...
davidair's user avatar
  • 175
9 votes
10 answers
2k views

I am attempting to write a script depending on the version of Debian. I have tried the following: #! /bin/bash DEBVERS=$(awk '{print $1}' /etc/debian_version) echo "DEBVERS = " $DEBVERS if [[...
Milliways's user avatar
  • 672
2 votes
1 answer
180 views

Good day, I have a directory with all my customers. (Auto Electrical). Inside every customer's directory is another directory with every booking they have booked with me before: -John_Smith --...
Danny's user avatar
  • 23
2 votes
2 answers
189 views

I am new to Bash and wanted some help. I have a command which produces four lines and I would like these lines to be fed to four variables, so i can use them in the next command. could someone please ...
Swetank Jackson's user avatar
0 votes
0 answers
60 views

I'm experimenting with Docker images having 20-70 GiB in a single layer (yes, the software/compiler is so fat). To improve the download and decompression efficiency of Docker, I'm splitting this fat ...
Paebbels's user avatar
  • 189
0 votes
2 answers
120 views

I have a bash script I am using to deploy updates automatically. It also includes logs of when the updates have been run. I have added the entire bash script below. The issue I am having is within ...
Kyle Sanders's user avatar
0 votes
0 answers
95 views

I'm trying to use find command with a backslash on the command below at groovy syntax: stage("ArtifactRename") { sh '''find "./os/mcu/GNU ARM v10.2.1 - Debug" -name "\\...
Sundeep Kumar Gorantla's user avatar
1 vote
1 answer
88 views

~$ echo $(date +%a%d\ %X) lun.24 17:40:28 ~$ inode-1 thunar.desktop lun.24% +17:40:40 ~$ cat inode-1 #/bin/bash # inode_check xdg-mime query default inode/directory >> /home/<user>/f1; ...
mazda's user avatar
  • 495
-1 votes
1 answer
405 views

Is jq guaranteed to always output valid json, even if it encounters an error while running? Error could be due to poorly formatted input, for example. Outputting valid json and not outputting anything ...
ghosts_in_the_code's user avatar
1 vote
0 answers
440 views

I can use syntax as below to list 6 files named a1b.md, a2b.md, a3b.md, x1y.md, x2y.md, x3y.md in a directory: ls a{1,2,3}b.md x{1,2,3}y.md I'd like to use something like this in a bash script; with ...
user74094's user avatar
  • 396
0 votes
1 answer
200 views

Hi everyone and thank you in advance! I used to run the following script with ncat Version 5.51 and it gave me wonderful formatting [root@server user]# for i in "cat server_list" ; do echo $...
ShadyYogaInstructor's user avatar
1 vote
1 answer
183 views

So I have to run a basic shell script that is not much more than: #!/bin/bash call01 call02 ... call_N If one of the calls fails (gets killed by the OS because it runs out of memory), what does it ...
Yuri Makassiouk's user avatar

15 30 50 per page
1
2 3 4 5
65