08-23-2013
Alternatively, you can use the <<- redirection operator, which allows leading tabs (not spaces, tabs only).
Franklin52's suggestion is more robust, but I mention this alternative for the indentation-obsessed (such as myself).
Regards,
Alister
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How to capture output or numeric part given by $? command into the variable?
If I go for
var=`$?`
then $var is found empty. (2 Replies)
Discussion started by: videsh77
2 Replies
2. UNIX for Advanced & Expert Users
hi i have small shell script as follows
cd /utilities/promoter/tmp
grep SENDREPLY $1 | grep 'zzzzz@zzz.com' | awk -F" -f1 > /tmp/$LOGNAME/$1.request
cd /tmp/$LOGNAME
grep -e "\.sql" -e "\.md" $1.request > upd_$1.txt
grep -v -e "\.sql" -e "\.md" $1.request > copy_$1.txt
... (1 Reply)
Discussion started by: zedex
1 Replies
3. Shell Programming and Scripting
Hi all,
I'm looking to write a script that is dependent upon the existence of 2 files each in separate directories. My thought was to do:
**psuedo code **
execute script
check directory 1 for file1
if file exists then
execute script 2 ( checking directory 2 for file 2)
else... (3 Replies)
Discussion started by: keladar
3 Replies
4. Shell Programming and Scripting
Hi Experts,
I have a script called test.sh. I am trying to execute it with sh -x test.sh. Where i can find sequence of steps executed one by one. Now i want to these executions to be captured in a file.
i.e sh -x test.sh > output.txt
the above one is notworking.
can anyone help me... (6 Replies)
Discussion started by: naree
6 Replies
5. Shell Programming and Scripting
Hi all, I have the requirement to generate the file containing following command
eval /path/ dsjob -logdetail projectname JOBNAME /path/
1. The file contains the above command say about 150 times i,e only the JOBNAME changes in every command
2. The commands must be written in such a way... (2 Replies)
Discussion started by: sanjay mn
2 Replies
6. Shell Programming and Scripting
HI All..
below is my menu options script. in option 2,3 and 4 im giving input and they are saving into their respective text file.
problem is when im trying to "cat" those files in options 7,8 and 9 im not getting the output. no respective file contents are displaying on screen. but if i... (1 Reply)
Discussion started by: saichand1985
1 Replies
7. Shell Programming and Scripting
Hi Experts,
I am very much new to linux scripting, I am currently working on reducing my manual work and hence writing a script to automate few task.
I am running below command to snmpwalk the router..
snmpwalk -v 3 -u WANDL_SU -a MD5 -A vfipmpls -x DES -X VfIpMpLs -l authPriv... (19 Replies)
Discussion started by: Hanumant.madane
19 Replies
8. Shell Programming and Scripting
below is the output xml string from some other command and i will be parsing it using awk
cat /tmp/alerts.xml
<Alert id="10102" name="APP-DS-ds_ha-140018-componentFailure-S" alertDefinitionId="13982" resourceId="11427" ctime="1359453507621" fixed="false" reason="If Event/Log Level(ANY) and... (2 Replies)
Discussion started by: vivek d r
2 Replies
9. UNIX for Dummies Questions & Answers
Hello Experts,
I am still learning linux and have come across a question, hope to get some answer.
I have two servers, and both have the same version of svn client installed and both have the same user_id.
my SVN client version:
svn, version 1.6.11 (r934486)
compiled Mar 2 2011,... (4 Replies)
Discussion started by: babyPen1985
4 Replies
10. UNIX for Dummies Questions & Answers
Hello All,
I was wondering if there is a way to execute a command in my ".bashrc" file based on how I logged into the PC?
I was thinking maybe there is a way to check how the user (*myself) logged in, maybe somehow with the who command along with something else, but I'm not sure... I know I... (7 Replies)
Discussion started by: mrm5102
7 Replies
LEARN ABOUT SUSE
sg_read_buffer
SG_READ_BUFFER(8) SG3_UTILS SG_READ_BUFFER(8)
NAME
sg_read_buffer - send a SCSI READ BUFFER command
SYNOPSIS
sg_read_buffer [--help] [--hex] [--id=ID] [--length=LEN] [--mode=MO] [--offset=OFF] [--raw] [--verbose] [--version] DEVICE
DESCRIPTION
Sends a SCSI READ BUFFER command to the DEVICE, and if there is a response either decodes it, prints it in hexadecimal or sends it in
binary to stdout. If a response is received for a "descriptor" mode then, in the absence of --hex and --raw, it is decoded. Response for
non-descriptor modes are output in hexadecimal unless the --raw option is given.
OPTIONS
Arguments to long options are mandatory for short options as well.
-h, --help
output the usage message then exit. If used multiple times also prints the mode names and their acronyms.
-H, --hex
output the response in hexadecimal.
-i, --id=ID
this option sets the buffer id field in the cdb. ID is a value between 0 (default) and 255 inclusive.
-l, --length=LEN
where LEN is the length, in bytes, that is placed in the "allocation length" field in the cdb. The default value is 4 (bytes). The
device may respond with less bytes.
-m, --mode=MO
this option sets the mode field in the cdb. MO is a value between 0 (default) and 31 inclusive. Alternatively an abbreviation can be
given. To list the available mode abbreviations given an invalid one (e.g. '--mode=xxx').
-o, --offset=OFF
this option sets the buffer offset field in the cdb. OFF is a value between 0 (default) and 2**24-1 . It is a byte offset.
-r, --raw
if a response is received then it is sent in binary to stdout.
-v, --verbose
increase the level of verbosity, (i.e. debug output).
-V, --version
print the version string and then exit.
NOTES
All numbers given with options are assumed to be decimal. Alternatively numerical values can be given in hexadecimal preceded by either
"0x" or "0X" (or has a trailing "h" or "H").
EXIT STATUS
The exit status of sg_read_buffer is 0 when it is successful. Otherwise see the sg3_utils(8) man page.
AUTHORS
Written by Luben Tuikov and Douglas Gilbert.
REPORTING BUGS
Report bugs to <dgilbert at interlog dot com>.
COPYRIGHT
Copyright (C) 2006-2007 Luben Tuikov and 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_write_buffer(sg3_utils)
sg3_utils-1.23 January 2007 SG_READ_BUFFER(8)