Sponsored Content
Top Forums Shell Programming and Scripting Append && echo "success" to all commands Post 302390538 by bigearsbilly on Thursday 28th of January 2010 08:25:04 AM
Old 01-28-2010
that would be naff and possibly dangerous
what if you had the following?

Code:
cat file |
sort |
uniq -c|
head


you could set -o errexit and it would exit at the first error.
or
Code:
trap "echo ERROR:" ERR

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

"nohup" and "&" commands

Why would anyone ever type in a command like this: nohup command & nohup lets you logout of your telnet session so why add "&" to run it in the background? (1 Reply)
Discussion started by: xadamz23
1 Replies

2. What is on Your Mind?

[[ $(date +%Y) == 2007 ]] && echo "Happy New Year"

Same as the Title! :) (2 Replies)
Discussion started by: ripat
2 Replies

3. Shell Programming and Scripting

"sed" to check file size & echo " " to destination file

Hi, I've modified the syslogd source to include a thread that will keep track of a timer(or a timer thread). My intention is to check the file size of /var/log/messages in every one minute & if the size is more than 128KB, do a echo " " > /var/log/messages, so that the file size will be set... (7 Replies)
Discussion started by: jockey007
7 Replies

4. Shell Programming and Scripting

What does this really mean? "tty -s && stty istrip"

I am having hard time understanding what this really do to the environment? I do understand this part "tty -s && stty " but not "istrip" # stty command is executed only if a tty is attached to the process. # stty istrip : Strip input characters to 7 bits tty -s && stty istrip I am... (3 Replies)
Discussion started by: kchinnam
3 Replies

5. Red Hat

files having Script which works behind "who" & "w" commands

Dear All, plz print the path of files which have the script of "who" & "w" commands. thnx in advance. (6 Replies)
Discussion started by: saqlain.bashir
6 Replies

6. Shell Programming and Scripting

Replace dashes positions 351-357 & 024-043 with 0 & replace " " if exis with 04 at position 381-382

I need to replace dashes (i.e. -) if present from positions 351-357 with zero (i.e. 0), I also need to replace dash (i.e “-“) if present between position 024-043 with zero (i.e. 0) & I replace " " (i.e. 2 space characters) if present at position 381-382 with "04". Total length of record is 413.... (11 Replies)
Discussion started by: lancesunny
11 Replies

7. Shell Programming and Scripting

finding the strings beween 2 characters "/" & "/" in .txt file

Hi all. I have a .txt file that I need to sort it My file is like: 1- 88 chain0 MASTER (FF-TE) FFFF 1962510 /TCK T FD2TQHVTT1 /jtagc/jtag_instreg/updateinstr_reg_1 dff1 (TI,SO) 2- ... (10 Replies)
Discussion started by: Behrouzx77
10 Replies

8. Web Development

How would I mod_rewrite "/~a1Pha" and "/=a1Pha" to "/paste/a1Pha.htm"? (internally & externally)

Basically I want to shorten URLs on my html pasting site (pasteht.ml), by using "/~a1Pha" instead of "/paste/a1Pha". The ID is 5 numbers and letters, both cases. For example: /~idnum serves /paste/idnum.htm /=idnum serves /paste/idnum.htm /paste/idnum redirects to /~idnum (to update any old... (0 Replies)
Discussion started by: phillips1012
0 Replies

9. UNIX for Beginners Questions & Answers

Echo "abc" | sed - r 's/a/&_&/

I want to know the working of & here step by step using sed command. (1 Reply)
Discussion started by: Preeti07
1 Replies

10. Shell Programming and Scripting

find files in sub dir with tag & add "." at the beginning [tag -f "Note" . | xargs -0 {} mv {} .{}]

I am trying find files in sub dir with certain tags using tag command, and add the period to the beginning. I can't use chflags hidden {} cause it doesn't add period to the beginning of the string for web purpose. So far with my knowledge, I only know mdfind or tag can be used to search files with... (6 Replies)
Discussion started by: Nexeu
6 Replies
MSGFMT_GET_ERROR_CODE(3)						 1						  MSGFMT_GET_ERROR_CODE(3)

MessageFormatter::getErrorCode - Get the error code from last operation

	Object oriented style

SYNOPSIS
public int MessageFormatter::getErrorCode (void ) DESCRIPTION
Procedural style int msgfmt_get_error_code (MessageFormatter $fmt) Get the error code from last operation. PARAMETERS
o $fmt - The message formatter RETURN VALUES
The error code, one of UErrorCode values. Initial value is U_ZERO_ERROR. EXAMPLES
Example #1 msgfmt_get_error_code(3) example <?php $fmt = msgfmt_create("en_US", "{0, number} monkeys on {1, number} trees"); $str = msgfmt_format($fmt, array()); if(!$str) { echo "ERROR: ".msgfmt_get_error_message($fmt) . " (" . msgfmt_get_error_code($fmt) . ") "; } ?> Example #2 OO example <?php $fmt = new MessageFormatter("en_US", "{0, number} monkeys on {1, number} trees"); $str = $fmt->format(array()); if(!$str) { echo "ERROR: ".$fmt->getErrorMessage() . " (" . $fmt->getErrorCode() . ") "; } ?> The above example will output: ERROR: msgfmt_format: not enough parameters: U_ILLEGAL_ARGUMENT_ERROR (1) SEE ALSO
msgfmt_get_error_message(3), intl_get_error_code(3), intl_is_failure(3). PHP Documentation Group MSGFMT_GET_ERROR_CODE(3)
All times are GMT -4. The time now is 08:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy