Stack Exchange Network

Stack Exchange network consists of 174 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
0answers
47 views

How to silence grep errors when used with a variable? [on hold]

Note: I have a work around for this but feel that I shouldn't need it. The following errors silently when typed into terminal grep -oP "path:\K(.+)/([^/]+)" ./tasks.txt -s In a script file, the ...
14
votes
7answers
951 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
50 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
76 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
0answers
13 views

GDBus.Error:org.freedesktop

When I open the properties of (Program/Folder/File) I get this error. any solution ??
0
votes
1answer
20 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 ...
0
votes
1answer
70 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
15 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
66 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
27 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
24 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
66 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
83 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
34 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
38 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
80 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
33 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
45 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
43 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
130 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
64 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
48 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
643 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
42 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
126 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
43 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
243 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
138 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
50 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
24 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
995 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
317 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
17 views

djvulibre-3.5.27 Build Error

I am currently on Linux Mint 18.3. I downloaded the package from the Djvulibre website. I'm new to compiling software. Here is my error: make[2]: Entering directory '/home/amucs/Downloads/djvulibre-...
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
37 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 ...
-2
votes
1answer
4k views

apt-get update Kali Linux error [duplicate]

I tried updating with apt-get update && apt-get upgrade as well as with apt-get update --fix-missing and apt apt-get clean && apt-get update && apt-get dist-upgrade but it ...
0
votes
0answers
47 views

How to filter out warning messages from yum?

I have installed via yum some packages as follows: $ yum install ambari-agent During installation there are a lot of warnings (see below). Is it possible to block these warnings but see only the ...
-2
votes
1answer
136 views

Redirect the error to /dev/null [closed]

I have a shell script with the line COMPRESS_OPTION=`which compress` There is no compress utility installed in our server, hence it gives the error which: no compress in (/usr/local/bin:/bin:/usr/...
0
votes
0answers
38 views

Variable expansion succeeds with echo but fails without a command (execution by expansion) [duplicate]

I created a file nano ~/uncwe/configurations/variables.sh. This file contains: set -a rse="~/${repo}/internal_software/rse.sh" set +a I sourced the file, then tried to execute: ${rse} bash ${rse} ...
2
votes
2answers
534 views

Suppress all output in yum except for errors

In yum when you do an update with yum update you normally get all success and error messages output on the CLI. Is there any way to have yum suppress all successful package installations and only ...
3
votes
1answer
840 views

Show error message if bash script terminates due to set -e

I want to terminate script if any command returns nonzero value, what I achieved by adding set -e. Now script fails on encountering problems (what is desirable) but it is easy to miss it - some ...
0
votes
4answers
676 views

/bin/sh returns 0 when it did not find a command in an if statement, is that expected?

I wrote a C++ watchdog that runs a set of scripts to determine whether there is a problem on that system. The code is a bit hairy so I won't show it here, but it is equivalent to a system call as ...
0
votes
1answer
396 views

Can't boot after updating OS update on CentOS 7

I'm using CentOS 7 with gnome UI After I use software update tool and install&restart the OS update it can't boot, it can go through the pass phase for the disk but keep spinning and can't access ...
0
votes
1answer
107 views

How to add set -e to all default bashes?

To make a bash script exit after any failed command, you can add set -e Imagine, you have a CI agent which allow people to embed bash scripts as tasks in build jobs. How to make the exit ...
0
votes
1answer
610 views

Concalc - “tcsetattr error: Inappropriate ioctl for device”

In a bash script I use the following: #!/bin/bash calc=$(concalc "$*") printf "%s\n" "$calc" I do get the result I want, but allways with this error message: tcsetattr error: Inappropriate ioctl ...
0
votes
1answer
1k views

Cant Start Hostapd because multiple Errors

How i said in the title 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 ...
0
votes
0answers
336 views

modprobe: ERROR: ../libkmod/libkmod-module.c:959 command_do() Error running install command for cifs

after I searched through a wide amount of posts in different boards, tortured google in any way possible and tried a lot of stuff myself I came to a dead end. I try to mount a Strato Hi-Drive (http://...
0
votes
3answers
492 views

Upgrade from fedora 25 to 27 - Conflict issue

I tried to upgrade from fedora 25 to fedora 27. When running sudo dnf system-upgrade download --releasever=27 --allowerasing I encountered a transaction check error regarding python. The error ...
0
votes
1answer
172 views

How to resolve [1]+ Exit 1 error?

I want to run four different R codes on linux batch using the following command: nohup R CMD BATCH code_name.R& I could run 2 of the codes on background, but running the other two codes, I get ...