Questions tagged [error-handling]
Use this tag for questions on how to handle errors generated in shell scripts.
343
questions
0
votes
2
answers
115
views
How to execute command if previous command fails with return code 0
I have a script which logs in to a server. Regardless of the success (i.e. whether the password is valid or not) the script will exit with return code 0, and the text:
Error login failed.
I'd like it ...
1
vote
1
answer
46
views
bwrap: execvp com.github.tchx84.Flatseal: No such file or directory flatpak
Some background of what happened.
I was playing with Flatseal to try few themes on my flatpak appliacations, and after some workarounds here and there, I accidently removed some file section in the ...
0
votes
2
answers
50
views
tar: ./.tar.gz: file changed as we read it | "Flagged" files are unrelated to the file tar is supposed to operate on
I am trying to use tar to recursively compress all files with the .lammpstrj extension within the directory tree starting at the directory whose path is stored in the variable home. home contains the ...
0
votes
0
answers
54
views
bash: is it possible to make `errexit` work inside conditionals?
Consider the following script:
#!/bin/bash
set -o errexit -o xtrace
qux() {
false
echo QUX
}
quux() {
qux ||:
echo QUUX
}
quux
Running this script produces:
+ quux
...
0
votes
0
answers
25
views
Cannot capture a handshake when sniffing
I cannot find a way to get a Handshake from my own wireless network, which has a WPA2 encryption. Please, note that this is not the first time I do this at all. In fact, I've captured tons of ...
0
votes
0
answers
268
views
How to deal with ALSA errors
Using some very simple example code to do speech-to-text in Python it works, but spews out a stream of the following errors and warnings:
Cannot connect to server socket err = No such file or ...
1
vote
1
answer
84
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 ...
0
votes
1
answer
52
views
Some GTk3 applications aborting with BadAccess when DISPLAY=:0 but not DISPLAY=hnam.local:0 or even DISPLAY=unix:0
I've had some issues with my XQuartz environment not starting due to a bit of a freak reason that was a rather hard to figure out. It's (mostly) working again but I must have caused another regression ...
3
votes
1
answer
205
views
How to code defensively in Bash for unhandled runtime errors within logical expressions?
I just encountered an error where a function was missing in my script. I already trap and raise these exceptions to stop the script early, but I noticed that did not occur. Investigating this further, ...
0
votes
0
answers
20
views
errexit and lists [duplicate]
set -eu
sh -euc 'echo 1; false; echo 2' || echo fail
f() {
echo 1
false
echo 2
}
{ echo 1; false; echo 2; } || echo fail
( echo 1; false; echo 2; ) || echo fail
f || echo fail
Output (at ...
-5
votes
1
answer
57
views
virtual machine stuck [closed]
My virtual machine stuck on this and just keep downloadin for hours please solve
0
votes
1
answer
277
views
grep: /proc/cpuinfo: No such file or directory
I am using a Mac computer and I get this message when running mirdeep2 mapper.pl script:
grep: /proc/cpuinfo: No such file or directory
0
votes
0
answers
25
views
What's the equivalent of the apport-retrace (Ubuntu) command for Debian?
I have some freezing troubles I cannot find the cause for a long time on my Debian VM,
and I'm interested in using a command apport-retrace that a Linux magazine I've bought promotes to do some ...
2
votes
1
answer
244
views
SSH session termination on script error when sourcing multiple sub-scripts
I'm facing an issue with SSH on a server. Running individual scripts (source s01.sh, etc.) works fine, with errors displayed in the console. However, when using a master script to source these scripts,...
0
votes
1
answer
50
views
Error with kali linux win-dex-install
I just installed wsl kali Linux on Windows but this error came up while installing win-dex -y command. I need this for class and I can't figure it out. I'm new to Linux and need help, please. What ...