The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
2answers
189 views

apt-get update failed to fetch and /sources.list.d/ empty

Running the sudo apt-get update command, I got the following error: Fetched 988 kB in 16s (59,3 kB/s) W: Failed to fetch ...
0
votes
1answer
18 views

Warning message after updating

I have Linux Mint 17 Cinnamon edition and after updating using the terminal: sudo apt-get && sudo apt-get upgrade I got this warning message: ... Building dependency tree Reading ...
1
vote
2answers
74 views

Capture errors in a SFTP script

I have a sub sh file which puts receives an input of local directory and path to the remote directory and sends the file to the remote directory. If the remote path is invalid the error cannot be ...
1
vote
1answer
33 views

Print nth pipeline command in bash

In bash, the PIPESTATUS array holds the return values of commands in a pipeline. Suppose that in the pipeline cmd1 | cmd2 | cmd3, the second command returns an error. Checking PIPESTATUS gives the ...
1
vote
1answer
175 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 ...
-1
votes
2answers
43 views

Why to set errno to zero at the time of initialization of the program and can't test it before error occurred? [closed]

I am reading the material available on errno variable of <errno.h> header file. I read : " A value of 0 indicates that there is no error in the program." and "As a good practice, developer ...
1
vote
0answers
314 views

Repeated error : #error “Only <glib.h> can be included directly.”

I have a research on author attribution compression distance. And I should use "Complearn" ,which is a compression program, in my work. But in the beginning I have problem in installing this program. ...
1
vote
1answer
153 views

open() return new file descriptor posix [closed]

I have to set the return values for open() in posix. How do I return "the new file descriptor" as it is said in the Linux man pages: RETURN VALUE open(), openat(), and creat() return the new ...
0
votes
1answer
252 views

How to get non-zero exit code from Puppet when configuration cannot be applied?

I've tried the following Puppet configuration to disable the root password: class users { user { 'root': password => '*', } } But after applying it with no warnings or error messages I ...
1
vote
4answers
206 views

Mute system error message in a script file and display mine

I have created a simple script to move all the files with .sh suffix in the current working directory to a designated directory If there was no such file, the script should output only an error ...
3
votes
1answer
81 views

How to make dd fail if it invalid skip value is specified?

When I invoke dd with an invalid value for skip it prints an error message and does nothing, but doesn't return with a value different from 0, e.g. $ cd /tmp $ mkdir xy $ cd xy $ truncate -s 2M ...
4
votes
2answers
121 views

Shell script error handling while assigning STDOUT to variable

I am trying to implement error handling in my shell script as described in the 2nd answer in Best practice to use $? in bash? My script looks like this: #!/bin/bash try() { "$@" code=$? ...
1
vote
1answer
192 views

TCL script try catch

I have a TCL script that sets a number of variables and reads several files. The last file it reads may contain sensitive information, so I need to make sure this file gets deleted even if an error ...
4
votes
3answers
237 views

why bash increment: `n=0;((n++));` return error? [duplicate]

n=0; ((n++));echo "ret=$?;n=$n;" ((n++));echo "ret=$?;n=$n;" ((n++));echo "ret=$?;n=$n;" from n=1 on, ((n++)) works correctly, only when n=0, ((n++)) return error, and I am using a trap '' ERR that ...
3
votes
0answers
127 views

Errtrace and local

I am using the following script: #!/bin/bash -Eu trap 'echo Hi' ERR exit_failure() { echo "Hello, World!" return 1 } sub_failure() { res=$(exit_failure) } sub_failure It results in the ...
3
votes
2answers
224 views

bash 'nounset' on sub-shell/child doesn't force main script to exit, how to workaround that globally?

With this script: tstNounset.sh #!/bin/bash set -x set -o nounset;set -u echo `echo $str` function FUNC1() { echo $str; };export -f FUNC1;bash -c FUNC1 function FUNC2() { set -u;echo $str; };export ...
0
votes
1answer
173 views

Using trap with ERR: How do I send $?

In bash 4.x If I have: err_handler() { echo You received error $1|mail -s "script error" MAILTO } trap err_handler ERR how do I send the actual stderr output to the function when the trap is ...
8
votes
3answers
282 views

How do I capture the exit code / handle errors correctly when using process substitution?

I have a script that parses file names into an array using the following method taken from a Q&A on SO: unset ARGS ARGID="1" while IFS= read -r -d $'\0' FILE; do ARGS[ARGID++]="$FILE" done ...
3
votes
1answer
292 views

Strange error (?) when I run `man` command from a folder that no longer exists

Let's have a look at the followings: radu@Radu:~$ mkdir test radu@Radu:~$ cd test radu@Radu:~/test$ rmdir ~/test radu@Radu:~/test$ man ls man: can't change directory to '': No such file or directory ...
4
votes
2answers
4k views

How to check whether a command such as curl completed without error?

I am using curl to upload a file to a server via an HTTP post. curl -X POST -d@myfile.txt server-URL When I manually execute this command on the command line, I get a response from the server like ...
6
votes
2answers
449 views

Making sure a command has executed in bash

I have a bash file with commands to merge pcap files. I want to know if there is anyway to make sure a line in bash runs or not. Like in windows bat file we have %ErrorLevel% ¨ Say a command touch -r ...
4
votes
2answers
2k views

chmod + silent mode + how force exit code 0 in spite of error

Is it possible execute chmod and ignore error from command Example ( remark file.txt not exsist to show the example ) When I type chmod 777 file.txt I get error on the output chmod: cannot ...
4
votes
2answers
342 views

How to implement logwatch functionality on top of systemd journal?

Logwatch scans logfiles with regular intervals, collects errors and stuff, then mails it to the admin. This was back in syslog and logfiles days. What's the corresponding solution for systemd's ...
2
votes
1answer
326 views

How to have a bash script perform a specific action on errors of _each_ command?

Similarly to set -e performs an exit on "uncaught" $? != 0, I'd like to have this event trigger the execution of another command, e.g. a logger call. How can this be done?
5
votes
2answers
1k views

How does Linux md-RAID handle disk read errors?

There are 2 cases: the read command times out at kernel level (30 seconds by default), the drive reports its unability to read a given sector before the kernel lose patience (the case I'm ...
4
votes
1answer
610 views

Bash capture any error like -e but don't exit, do something else

I want to set a flag in a shell script (bash) so that if anything returns non-zero, a flag is set (i.e. set a variable like errors="True"). So far, I've thought of calling the script with ...
1
vote
1answer
299 views

Unwanted messages every time I attempt to login?

I am using Linux Mint Olivia and it worked fine for past couple of months but from yesterday it keep showing these message whenever I want to login to my PC: Keys: Press S to skip mounting or M for ...
2
votes
2answers
80 views

Different error messages when using different strings in terminal

When I insert, for example, unix.stackexchange.com followed by Enter in terminal, I get the following error: unix.stackexchange.com: command not found This is ok and as I expected. But when I insert ...
3
votes
4answers
10k views

How to catch an error in a linux bash script?

I made the following script: # !/bin/bash # OUTPUT-COLORING red='\e[0;31m' green='\e[0;32m' NC='\e[0m' # No Color # FUNCTIONS # directoryExists - Does the directory exist? function directoryExists ...
3
votes
2answers
303 views

Getting the complete command line that caused an ERR , while trap

How do I make trap to return the command that caused an ERR? $function err_handler() { echo "$0 caused the error"; } $ trap err_handler ERR $ grep -ci "failed" test4 &>/dev/null -bash caused ...
1
vote
1answer
142 views

Detecting SSH timeout

Is there any way I could trigger a bash script when ssh times out? I have an alias to set the tmux title when starting ssh. The alias also includes a title change after the ssh session, which works ...
2
votes
3answers
445 views

Exception handling when using tail -f to monitor a log

I have a main script calling the script to do the monitoring. I am trying to catch the exception that the log is missing or not accessible anymore. tail -f is used instead of -F since the logs are ...
14
votes
4answers
4k views

How to make bash abort the execution of a script on syntax error?

To be on safe side, I'd like bash abort the execution of a script if it encounters a syntax error. To my surprise, I can't achieve this. (set -e is not enough.) Example: #!/bin/bash # Do exit on ...
7
votes
4answers
317 views

Which data should be excluded from log files , error messages etc. if posted online?

What data should one erase from log files, error messages etc., if posting them as a screenshot so as not to expose sensitive information? As I have little knowledge about this topic, I can vividly ...
9
votes
1answer
971 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 ...
4
votes
3answers
287 views

Mail cron output only when Git throws a real error

There exists a Git repo that is on one server, we want to generate doxygen output for it on a different server. The following command works for me but has the downside of sending a mail everytime the ...
3
votes
4answers
3k views

Suppress server message in rsync

When I rsync or scp from a particular server I get a rather long message telling me the rules of the server. However when I setup regular pulls, I'd like to be able to suppress those messages in my ...
3
votes
1answer
1k views

Capture screen content for error parsing

I am a database administrator working with DB2 on AIX. (Please continue to read as this is related more to ksh than DB2, otherwise I would have posted this over on dba.stackexchange.com.) I am ...
2
votes
2answers
14k 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 ...
2
votes
1answer
1k views

What does “DMA: Out of SW-IOMMU space” error mean?

First the link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1060268 Since this affects the kernel and other Distros, what does this type of error mean and why it happens?
1
vote
0answers
498 views

error: implicit declaration of function ‘rt_dev_socket’

The developer says: http://comments.gmane.org/gmane.linux.real-time.rtnet.user/2546 Now how can I tell the Makefile to look for headers in /usr/local/rtnet/include respectively ...
8
votes
1answer
5k 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 ...
2
votes
3answers
2k views

Does “226 Transfer complete” guarantee the consistency between local and remote files when using ftp?

I have some automated scripts which perform FTP uploads among other things. I'm wondering what level of error checking I should conduct once these uploads have finished executing. Could anything go ...
2
votes
1answer
305 views

crossplatformui error in Mint 11

Whenever I try to install something in my system it generally installs but shows some error related to "crossplatformui". I don't know what it is and how to remove it. I am printing here a sample ...
1
vote
1answer
3k views

Unprettyfied SSL error message?

I am trying to authenticate using my USB smartcard reader to a website. I am running Ubuntu 10.04 LTS, with its most up to date Firefox browser 3.6.24. I get the following error message: Secure ...
5
votes
3answers
875 views

Crontab job not emailing on failure

I have a cron job on Debian: 1 * * * * /home/paradroid/bin/myscript.sh >/dev/null There is an installed and configured MTA, and I have received emails when the script has a syntax error, so I ...
5
votes
2answers
2k views

Is it possible to get the error message from previous command which failed when the conditional command runs using ||

I have a helper function: function error_exit { /opt/aws/bin/cfn-signal ... exit 1 } This helper function is used to signal an error. Here is an example of usage: /opt/aws/bin/cfn-init -s ...
0
votes
1answer
511 views

How to fix “number of errors while writing to disk(or) multi-zone error rate”?

I ran hard disk checker, and i found this error: Write Error Rate: number of errors while writing to disk(or) multi-zone error rate (or) flying-height --- Normalized: 200 Worst: 200 Value: ...
4
votes
2answers
16k views

Can I fix bad blocks on my hard disk with a single command?

I'm working on fixing the errors in my Hard Disk, It's possible to do that manually but it might take hours. After typing this command sudo badblocks -b 512 /dev/sda, I got hundreds of results and I ...
3
votes
2answers
7k views

What does this hard disk error message mean: “Current Pending Sector Count …”?

I grabbed this information from Disk Utillity on Linux Mint: Current Pending Sector Count: Normalized: 200 Worst: 200 Threshold: 0 Value: 22 sectors What does it mean? Is it possible to ...