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
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

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
68 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
49 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-...
2
votes
1answer
404 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?
22
votes
4answers
39k views

Trap, ERR, and echoing the error line

I'm trying to create some error reporting using a Trap to call a function on all errors: Trap "_func" ERR Is it possible to get what line the ERR signal was sent from? The shell is bash. If I do ...
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
49 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-...
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 ...
1
vote
2answers
1k views

Halt the execution when something is written to stderr

I have trouble with error handling in bash scripts. None of the solutions I have seen for error handling in bash seem to work so far for this example script: #!/usr/bin/env bash set -euo pipefail ...
9
votes
3answers
61k views

blk_update_request: I/O error, dev fd0, sector 0

I recently started noticing some blk_update_request: I/O error, dev fd0, sector 0 errors on my second computer running Arch Linux that I use as a server. This began when I had to reboot the computer ...
0
votes
0answers
140 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
4k views

Cant Start Hostapd because multiple Errors

I have multiple errors while trying to start Hostapd I will post the errors output which i got after i tried to start it and looked at the status: root@l0calh0st:~# service hostapd status ● ...
10
votes
4answers
907 views

Silent disk errors and reliability of Linux swap

My understanding is that hard drives and SSDs implement some basic error correction inside the drive, and most RAID configurations e.g. mdadm will depend on this to decide when a drive has failed to ...
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 ...
1
vote
1answer
1k views

/sbin/ldconfig.real: /usr/local/lib is not a known library type

I was following this instruction on this site to installing tesseract: https://github.com/tesseract-ocr/tesseract/wiki/Compiling git clone https://github.com/tesseract-ocr/tesseract.git cd tesseract ....
29
votes
7answers
205k views

How to close X Server, to avoid errors while updating nVidia driver?

I tried to update my nVidia driver but I got an error when I ran the driver installation. See the error: ERROR: You appear to be running an X server; please exit X before ...
1
vote
1answer
3k views

Running R script via shell script. syntax error near unexpected token `('

I am currently trying to run an R script via a shell script. Here the R script: test = rnorm(1:100, 1000) write.csv(test, 'test.csv') And here the bash script which calls the R one: #!/bin/bash -l ...
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 ...
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
3answers
9k views

Shell script `rm -r`: Redirect write-protected prompt and answer “n”

I have a few lines in a shell script whose function is to iterate through directories, match some names, and delete them. Some areas of the file system are write protected and I would like to leave ...
16
votes
2answers
5k views

rsync: skip files for which I don't have permissions

I'm using rsync -rlptD to copy a directory from another user. There are a few files (I have no way of knowing these in advance) which I don't have permission to copy. Is there a way have rsync ignore ...
0
votes
1answer
222 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 ...
3
votes
1answer
837 views

trap on command exit not working unless used in a function or sub-shell

Am experimenting a bit with trap on invalid command return code using a sample code #!/bin/bash # Exit on error trap 'echo 'exiting..';exit' ERR set -e h=1 b=$((h+)) # <----- command causing ...
2
votes
1answer
52 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
2answers
688 views

Can't run the exe file [closed]

I have a code (.c file). And used the following command; #!/bin/bash # gcc file.c -o file.exe #./file.exe So when I try to run the .exe file (using Wine) I get an error which says "wine: Bad ...
0
votes
2answers
4k views

/usr/bin/install: cannot stat `run': No such file or directory

Im trying to build embeded software using this RSDK toolchain but after make menuconfig and make Im getting following error make[7]: Entering directory `/mnt/hgfs/A/rtl819x-toolchain/users/gdb/gdb-6....
0
votes
4answers
66 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
238 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/...
11
votes
5answers
7k views

Disable cron emails unless there are errors?

How can I only receive emails from cron if there are errors? In the overwhelmingly vast majority of cases, the tasks will run just fine - and I truly do not care about the output. It is only in the ...
1
vote
0answers
636 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 ...
0
votes
1answer
953 views

Writing the output of a command to a file in a bash script

I am trying to write a simple bash script that executes the command tcprobe -i $1 where $1 is an mp4 file. Then, I want to write the output of this command, which should be a long string of ...
4
votes
2answers
35k views

how to view php and server error logs?

I am getting the WSOD now since editing settings.php; php.ini and .htaccess trying to update my site and I need to see error logs to find out what is happening. Also how do you clear cache in command ...
0
votes
3answers
12k views

How do I fix wget on an HTTP url not trusted errors in kali?

When I try to run the wget command on http urls I get this error message: ERROR: The certificate of `url' is not trusted. ERROR: The certificate of `url' hasn't got a known issuer.
0
votes
2answers
1k views

Skip catching errors in a shell script

I have a script which compile a program. This program first compiles the source code using configure && make commands, then runs some tests using make test. This script also uses set -e to ...
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
248 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 ...
1
vote
1answer
2k views

Error trying to restart ssh

I am using Linux Mint 18, the same distribution I have been using most of the semester for school. I was tasked with making certain adjustments to the sshd_config file, including chaning the listening ...
0
votes
1answer
44 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
152 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:...
1
vote
1answer
1k views

Well Behaved Non-Zero Exit Codes?

It's my understanding that a unix shell shell script can, and should, issue an exit code. An exit code of zero means the program completed successfully, while a positive integer exit code (1-255) ...
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
225 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
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
149 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
233 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 ...