Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [error-handling]

Use this tag for questions on how to handle errors generated in shell scripts.

0
votes
1answer
24 views

ls reports nonexistent files first, ignoring the specified order

$ ls -lU a.txt test.sh badtest ls: cannot access 'badtest': No such file or directory -rw-r--r-- 1 gqqnbig gqqnbig 11 Apr 15 17:17 a.txt -rw-r--r-- 1 gqqnbig gqqnbig 11 Apr 16 17:22 test.sh Although ...
0
votes
1answer
69 views

Debian sources errors

When I try to update my packages on my Chromebook (with Linux installed on it) I do this: sudo apt-get update, and it gives me this error: Ign:1 https://deb.debian.org/debian stretch InRelease Ign:2 ...
0
votes
3answers
50 views

Linux/Debian dpkg & administrator errors

So today I ran into a bunch of errors while using the sudo command on my Chromebook with Linux installed. For example when I try to remove my Google Chrome beta application, I tried this: sudo apt-...
3
votes
1answer
350 views

What are these three extra chars and why do they cause such a strange error? [duplicate]

Look at these two files: File 1 File 2 They look to me entirely identical, but File 1 has 41 bytes and File 2 has 44 bytes. Now, I would not care about 3 extra chars, however, I think these chars ...
1
vote
1answer
51 views

Checking for invalid date in bash script

I am checking for a valid date scrpt.bash test 2019-05-03 date -d $2 2>: 1>:; c=$? If $c is 1 then the date is invalid. If I enter 2019-05-03 I will get a 0 which is correct. If i enter 2019-...
2
votes
1answer
432 views

fontconfig warning: “/etc/fonts/fonts.conf”, line 100: unknown “element blank”

Getting this error on my vps server: fontconfig warning: "/etc/fonts/fonts.conf", line 100: unknown element "blank" This is the file: https://pastebin.com/VqcSgJ9x How to fix it?
0
votes
0answers
150 views

how to make a Input/Output Error example?

I'm working on a simple game console for raspberry pi, and I want to handle some common errors like segmentation fault, arithmetic exception and input/output error (since there maybe some guys using ...
2
votes
1answer
45 views

Why does trap ERR behaviour differ over bash versions 3 and 4?

Background Execute the following code in bash 3, 4 and 5 respectively, and you will get differing results. (function handle_error () { echo ERROR; }; trap handle_error ERR; (exit 1)) Imagine that (...
0
votes
1answer
40 views

clang: error: no such file or directory: '_REENTRANT'

I am trying to install UDUNITS-2 package for the graphical visual browser: ncview. I need to understand the following error message: clang: error: no such file or directory: '_REENTRANT' A similar ...
0
votes
0answers
16 views

How can i check for errors of the nemo file manager?

Are there any terminal commands one can use to check if the nemo file manager (linux mint 19.1 cinnamon) is working properly? Asking, since i tend to get some error messages every now and then, ...
2
votes
1answer
53 views

Failing on errors inside a function which is called on the left-hand-side of an && expression

I am working on a Bash script with several functions. I would like to exit the script if any commands return an nonzero exit code, unless in a context where that code is being explicitly handled (such ...
0
votes
1answer
228 views

How to run Ansible playbooks only if there are no problems in the playbook?

I have learned of the command ansible-playbook example.yml --check which can tell me if something in my playbook is problematic (as far as Ansible can recognize). I think I should combine this ...
6
votes
3answers
809 views

How can I output a command to a file, without getting a blank file on error?

I'm trying to run a command, write that to a file, and then I'm using that file for something else. The gist of what I need is: myAPICommand.exe parameters > myFile.txt The problem is that ...
0
votes
4answers
67 views

How to debug my script?

This script name is hello for i in $(ls $*);do x=$(echo $(basename $i".md")); pandoc $i -t "latex" -o $x.pdf; done When I write this $ ./hello *bye.md This error ls: cannot access 'test': ...
1
vote
0answers
241 views

Error adding symbols: DSO missing from command line while compiling Ogre Meshy

Yes I read many questions for ex. this and this and this and this but nothing works for me. So basicaly Im trying to compile Ogre Meshy but Im getting an error [100%] Linking CXX executable bin/...
1
vote
0answers
643 views

Yum not found on Centos 7 “ No module named yum”

I recently installed CentOS 7 but have run into an issue with yum. I get the following error: There was a problem importing one of the Python modules required to run yum. The error leading to this ...
15
votes
7answers
1k views

How can I check if a file can be created or truncated/overwritten in bash?

The user calls my script with a file path that will be either be created or overwritten at some point in the script, like foo.sh file.txt or foo.sh dir/file.txt. The create-or-overwrite behavior is ...
-3
votes
1answer
1k views

Can not download from an HTTPS site (ssl) with wget?

I know my version of wget is very old, but I can't get a download to work with it, # wget https://github.com/radare/radare2/archive/master.zip --2018-11-05 00:07:51-- https://github.com/radare/...
2
votes
0answers
249 views

wget a zip file from GitHub, OpenSSL error [closed]

$ wget -O sindresorhus-is-online-master.zip https://github.com/sindresorhus/is-online/archive/master.zip --2018-11-03 13:48:20-- https://github.com/sindresorhus/is-online/archive/master.zip Resolving ...
0
votes
1answer
45 views

get an error typeset: not found when i launch my script by crontab?

I use this portion of code to set default values in my config on my script.sh # Copyright (c) 2015 # Licence MIT ( http://choosealicense.com/licenses/mit/ ). #!/bin/sh typeset -A config # init ...
1
vote
1answer
77 views

Shell script error to extract file data

I have attempted to write a shell script and it is giving an error which I cannot understand. The script goes like this: #!/bin/bash while read id do cat demuxR1/$id.barcode.in.R1.R1.fastq demuxR2/$...
0
votes
1answer
153 views

tar returns error but still unpacks file even though “tar --no-ignore-command-error -xvzf file.tar.gz” is used

I have a corrupted file called file.tar.gz and I want to the extraction of it to fail. I used tar --no-ignore-command-error -xvzf file.tar.gz but it still extracting the files, and ignoring the errors:...
0
votes
1answer
1k views

What exactly does “Illegal instruction (core dumped)” mean? [duplicate]

I see a lot of solutions to resolving the problem exemplified by Illegal instruction (core dumped) But, I'm wondering what exactly that means? What generates that error, and what's the root cause ...
0
votes
1answer
61 views

The /bin/ prefix to kill command is getting rid of the error message

I have Debian Stretch.. I thought that a regular user could kill root process as root. I was using the command /bin/kill 10733 as the user. There wasn't any error message. Then, I typed out the ...
0
votes
1answer
232 views

Makefile: Copy using make variables --> error; Not so without variables!

In the following makefile InputLocation:=./Test OutputLocation:=$(InputLocation)/Output Input:=$(wildcard $(InputLocation)/*.md) Output:=$(patsubst $(InputLocation)/%, $(OutputLocation)/%, $(Input:...
1
vote
0answers
151 views

I am getting this errror when trying to install the newest version of Python 3. Any ideas on how to fix it?

checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking for python3.7... no checking for python3... python3 checking for --enable-universalsdk... no ...
4
votes
1answer
238 views

Weird problem with Dwarf Fortress install

Here's the thing. I'm running Mint 19, relatively fresh install. I heard a lot of hype about Dwarf Fortress, and installed it once; then, needing to leave in a hurry, closed it with Control-C. Ever ...
1
vote
0answers
51 views

Scribbleton doesn't run on Linux Mint 19

I am trying to install and run Scribbleton on Linux Mint 19, but when I do ./run_scribbleton.sh nothing happens. Talking to the support, they asked me to modify the run_scribbleton.sh script to print ...
1
vote
0answers
53 views

Ubuntu 17.10 unmet dependencies error and unable to open apps including terminal [closed]

Okay, I have had this error for probably over 6 months and finally after being so lazy to do so am trying to get an answer to fix my problem. One day, doing absolutely nothing to screw up my Ubuntu, ...
0
votes
1answer
255 views

error: duplicated database entry using pacman [duplicate]

I issue $ pacman -Su :: Starting full system upgrade... error: duplicated database entry 'python2-cairo' there is nothing to do So I have a look at /var/lib/pacman/local $ ls /var/lib/pacman/local/...
-2
votes
1answer
93 views

Using the ping command on my VirtualBox Debian System returns no route but I can still connect to websites

For further clarification, I'm using a bridged adapter on VirtualBox and it's set to allow VMs (it is also using the correct adapter). This is what the terminal responds with after running the ...
1
vote
1answer
97 views

How to silently handle the “bash: /xyz: Is a directory” error in bash shell?

In zsh, executing the directory path will cd into it. I want to make bash shell to behave the same. The idea is to check and see if the error is bash: /xyz: Is a directory and cd into '/xyz' and ...
2
votes
1answer
72 views

Script error handling: need to report segfault in script run by ssh

I wrote a cron job, which uses ssh to run a script on a server. I just tried running the script, and now I am unhappy. client# ssh server.local /usr/local/bin/script client# server# /usr/local/bin/...
-2
votes
1answer
190 views

How to verify that the installation of Apache Server works?

Debian 9.5 Apache HTTP Server 2.4.34 (httpd) After installing Apache from the official page with sudo make install, I want to check that the installation works starting the server: $ sudo /usr/local/...
2
votes
1answer
152 views

Getting error code of the first command in pipe in ash

I use wget to download a big file to two FIFOs like that: wget <wget-args> -O - | tee -a "$fifo1" >> "$fifo2" I want to retrieve the error code of wget on failure. set -o pipefail ...
0
votes
2answers
61 views

How do I make this script output: “Error connecting to Mom via SSH” when connection is down?

Intention I am in the middle of writing a little shell script (POSIX, except for the system_beep()). The script, which runs in Cygwin, should find out, if my mother's laptop is closed or not and ...
1
vote
0answers
925 views

“unexpected EOF while looking for matching `)'” - when trying autocomplete [duplicate]

Whenever I start typing in a command which uses $( ) expansion, and I press tab while typing in the inner command, I get an error: unexpected EOF while looking for matching `)' Thus, for example, I ...
1
vote
0answers
49 views

Why does trying to open a sub-shell in a for loop give a syntax error at done?

If I execute this bash script: #!/bin/bash j=0 for(( i=1;i<(j);i++ )) do echo j done I get: ./test: line 6: syntax error near unexpected token `newline' ./test: line 6: `done' I know that the ...
0
votes
2answers
208 views

How to make systemd not hang (unresponsive system), but provide emergency shell?

I am not very familiar with systemd. The answer I seek with this question is: How is it possible to make systemd react to problems with "dropping the user into an emergency shell of sorts", instead ...
1
vote
1answer
53 views

Does we need a delay time between command in Linux ?

I have a script process.csh for processing many files through many steps which the above output is the input of below command. Do I need to insert a delay between commands to be sure there is no ...
2
votes
1answer
347 views

Trap and collect script output, “input file is output file” error?

I need to upload the output of the current script, so I added a trap and set -ex, e.g #!/bin/bash exec &> /tmp/error.log trap 'cat /tmp/error.log; curl http://127.0.0.1/error.php?hostname=$(...
2
votes
1answer
186 views

Has anyone tried to write a shell that fixes errexit (`set -e`)?

errexit (set -e) is often suggested as a way to make simple scripts more robust. However, it is generally regarded as a horrible trap by anyone who has seen how it behaves in more complex scripts, in ...
1
vote
2answers
51 views

Redirect all lines of code to the same file in a single line

I have the following command set used to update all my WordPress sites in my CentOs shared-hosting partition on my hosting provider's platform (via daily cron). The wp commands inside the pushd-popd ...
1
vote
0answers
2k views

the 'grub-efi-amd64-signed' package failed to install into /target/

I am trying to install Ubuntu 18.04 but I get this error at the end of installation process! I tried to create a partition with ext4 for \boot. also ext1 but non of them worked. Also I tried to ...
0
votes
0answers
32 views

(eog:7086): EOG-CRITICAL **: eog_job_thumbnail_cb: assertion 'EOG_IS_LIST_STORE (data)' failed

I am trying to use eog in my c++ code like this: system("eog --disable-gallery --single-window 1.jpg &"); But it gives me this error message: (eog:7086): EOG-CRITICAL **: ...
0
votes
1answer
2k views

json.cpp:474:23: fatal error: curl/curl.h: No such file or directory

I am trying to compile ChatScript but I get this error message: json.cpp:474:23: fatal error: curl/curl.h: No such file or directory When I try apt-get install curl it says: curl is already ...
0
votes
0answers
355 views

E: Sub-process /usr/bin/dpkg returned an error code (1) when tried to install espeak

I tried to install sudo apt-get install espeak But I got: Reading package lists... Done Building dependency tree Reading state information... Done espeak is already the newest version (1.48.04+...
1
vote
1answer
25 views

djvulibre-3.5.27 Build Error

I am currently on Linux Mint 18.3. I downloaded the package from the Djvulibre website. Here is my error: make[2]: Entering directory '/home/amucs/Downloads/djvulibre-3.5.27/desktopfiles' PNG ...
1
vote
2answers
4k views

Random firmware error after update on my Kali system

Well, isn't that just terrific. After updating my system (Kali GNU/Linux 2018.1 variation, to be specific), I got the following message on boot: [ 14.146398] platform regulatory.0: firmware: failed ...
0
votes
3answers
39 views

How can I limit the number of error messsages displayed after compiling a C++ program?

I am compiling a C++ program with g++ and each time get a huge number of errors, forcing me to scroll up every time I want to view the first (and most relevant) error. I am wondering if there is an ...