Sponsored Content
Top Forums Shell Programming and Scripting Ed command execution in script file Post 302846255 by alister on Friday 23rd of August 2013 10:06:49 AM
Old 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

Capturing last command execution status in a script.

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

command execution ??

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

Script execution dependent upon a file landing in a certain directory

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

Execution Output of a shell script into a file.

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

Parallel execution of command inside file

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

Execution Problem with dispalying file content using menu driven script

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

Want to terminate command execution when string found in the command output

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

Multiple command execution inside awk command during xml parsing

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

Execution of command at command prompt

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

Bashrc File - Conditional Command Execution?

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
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. When given twice the response is output in hex with the corresponding representation in ASCII to the right of each line. -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 use an invalid one (e.g. '--mode=xxx'). As an example, to fetch the read buffer descriptor give '--mode=desc' . -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-2011 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.31 February 2011 SG_READ_BUFFER(8)
All times are GMT -4. The time now is 03:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy