Sponsored Content
Full Discussion: Print Error with set command
Top Forums Shell Programming and Scripting Print Error with set command Post 302295113 by Shribigb on Friday 6th of March 2009 05:08:09 PM
Old 03-06-2009
Print Error with set command

I need to print some mandatory instructions if something fails in the script. I am using set -e to check and exit the script if some scripts/commands return non zero exit code. Is there any way to print these instructions with set command??
 

10 More Discussions You Might Find Interesting

1. Solaris

how to set font for Print

I want one help from you.I got one printer related task in which when user is printing some doc , Font size is big. He want to reduce the size.we are using SUN SOLARIS (Text Based - NON GUI) operation system. Can you tell me , what could be the reason and how to check default font size and style... (0 Replies)
Discussion started by: ahuja_kishor
0 Replies

2. AIX

Can you set up a networked printer as a local print queue?

Fairly simple question, I think. Still trying to get my head around AIX print queues. Most of our problems seem to stem from print queues going down. This generates help-desk calls when users call up to get their queues started or to get rid of the emails that qdaemon sends them. Looking at... (0 Replies)
Discussion started by: alexop
0 Replies

3. Shell Programming and Scripting

How to print error and exit if command fails?

Guys any tips on printing a certain error message to stderr and exiting should a command fail within a ksh script? I'm trying to null some output files. Touch isn't suitable as i need to null them. print "" > file isn't suitable as i need to check elsehere for if they are 0bytes or not. ... (5 Replies)
Discussion started by: lavascript
5 Replies

4. Shell Programming and Scripting

set -o vi giving set: Syntax error

when trying : set -o vi getting error like- : set: Syntax error help me Double post (of sorts). Continue here. (0 Replies)
Discussion started by: RahulJoshi
0 Replies

5. Shell Programming and Scripting

print running field average for a set of lines

Hi everyone, I have a program that generates logs that contains sections like this: IMAGE INPUT 81 0 0.995 2449470 0 1726 368 1 0.0635 0.3291 82 0 1.001 2448013 0 1666 365 1 0.0649 0.3235 83 0 1.009 2444822 0 1697 371 1 ... (3 Replies)
Discussion started by: euval
3 Replies

6. HP-UX

What is the use of command set -- and set - variable?

Hi, I am using hp unix i want to know the use of the following commands set -- set - variable thanks (4 Replies)
Discussion started by: gomathi
4 Replies

7. Shell Programming and Scripting

Error in script for set command

Hi All I have a function in a Linux script as follows echo `date`": Info: Started Checking File Pattern(s)" cat ${CM_FILE_SPLIT_LST} | while read SPLIT_INFO do #lets not expand wildcards set -f #FILE_PATTERN=`echo ${SPLIT_INFO} | awk '{FS="|"; print $1}'` ... (6 Replies)
Discussion started by: vee_789
6 Replies

8. Shell Programming and Scripting

Print specific lines of a repeated set of data

I have a file that needs 1st line, 2nd line, and 26th line printed from every chunk of data. Each chunk of data contains 26 lines (#line+%line+24 data lines = 26 lines of data repeated). Input file: # This is a data file used for blockA (chunk 1). % 10576 A 10 0 1 04 (data1) 03 (data2)... (2 Replies)
Discussion started by: morrbie
2 Replies

9. Shell Programming and Scripting

HHow to print the group with a highest value within a set

How to print the names with a highest value within a set and filter if it is the only unique group within the same set input sets names value groups j007 shot1 0.6 a j007 shot2 0.5 b j007 shot3 0.4 bb j007 shot4 0.3 bc j007 shot5 0.2 ... (8 Replies)
Discussion started by: quincyjones
8 Replies

10. Shell Programming and Scripting

sed - print only the chars that match a given set in a string

For a given string that may contain any ASCII chars, i.e. that matches .*, find and print only the chars that are in a given subset. The string could also have numbers, uppercase, special chars such as ~!@#$%^&*(){}\", whatever a user could type in without going esoteric For simplicity take... (1 Reply)
Discussion started by: naderra
1 Replies
SCSI_SATL(8)							     SG3_UTILS							      SCSI_SATL(8)

NAME
scsi_satl - check SCSI to ATA Translation (SAT) device support SYNOPSIS
scsi_satl [--help] [--log] [--quiet] [--verbose] DEVICE DESCRIPTION
This Bourne shell script calls several SCSI commands on the given DEVICE that is assumed to be an ATA device behind a SCSI to ATA Transla- tion (SAT) layer (SATL). The results of each test and a pass/fail count are output. OPTIONS
Arguments to long options are mandatory for short options as well. -h, --help print out the usage message then exit. -L, --log the output to stderr (from each SCSI command executed) is appended to a file called 'scsi_satl.err' in the current working direc- tory. -q, --quiet the amount of output is reduced and typically only the pass/fail count is output. -v, --verbose increase level or verbosity. EXIT STATUS
The exit status of this script is the number of "bad" errors found. So an exit status of 0 means all mandatory SCSI commands worked as expected. AUTHORS
Written by D. Gilbert COPYRIGHT
Copyright (C) 2011 Douglas Gilbert This software is distributed under a FreeBSD license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR- POSE. SEE ALSO
sg_inq, sg_luns, sg_turs, sg_requests, sg_vpd, sg_senddiag, sg_modes, sg_sat_identify (sg3_utils) sg3_utils-1.33 December 2011 SCSI_SATL(8)
All times are GMT -4. The time now is 06:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy