Sponsored Content
Top Forums Shell Programming and Scripting Strange third argument in shell function Post 303001043 by Corona688 on Tuesday 25th of July 2017 03:10:49 PM
Old 07-25-2017
It becomes N whenever its empty, so by not giving a third argument, you are setting RESET_ALL to N.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Passing Argument to Function

May i know how to pass an argument to a function in a shell script? Sorry, i din stated that it is in a shell script in my previous post. Means: checkStatus() { ........... } read status; I wanna use the status in the function checkstatus, how... (2 Replies)
Discussion started by: AkumaTay
2 Replies

2. Shell Programming and Scripting

shell: creating different arrays based on function argument

hi, I was wondering if there was a good way to create an array within a function, where the name is based on a passed argument? I tried this: _____________________________ func(){ #take in 1st arg as the arrayname arrayName=$1 let i=0 while read line do arrayName=${line} let i+=1... (5 Replies)
Discussion started by: nix21
5 Replies

3. UNIX for Dummies Questions & Answers

Pass argument to function

Hi, Can someone please explain to me how I can get a function to recognize a file given as an argument to a script. Suppose the script has the argument as follows: sh script file and the function is as follows: function display_file () { cat $1 } and it s then called #main program... (1 Reply)
Discussion started by: Knotty
1 Replies

4. Shell Programming and Scripting

Very strange things happened in the shell function

Here is the script: #!/bin/bash #set -xv RAWDATAFILE="temp1" GOODDATAFILE="temp2" FindSOS() { local NUM=0 #return value for the id of SOS local cnt=1 if grep "EOS" $1 then sed -e 's/.*<CobDate>//' -e 's/<\/.*//' <$1 > ${RAWDATAFILE} sed -n -e '/EOS/,/SOS/ s/*/&/p' <${RAWDATAFILE}... (2 Replies)
Discussion started by: tpltp
2 Replies

5. Linux

Strange problem with gettimeoftheday function

Hi all, I am using pthread_cond_timedwait function in my program, to generate the time period of waiting i use gettimeoftheday function. When i run the code after compiling i get a core dump error. However my program runs perfectly if i give a printf statement before the gettimeoftheday... (1 Reply)
Discussion started by: xyz123456
1 Replies

6. Shell Programming and Scripting

Passing more than one argument in a function

Hi All, Calling a function with one argument and storing the return value in a shell script is as below:( so far I know) value="`fun_1 "argument1"`" Its working perfectly for me. Can u help me with passing more than one argument and storing the return value Thnaks in advance JS (1 Reply)
Discussion started by: jisha
1 Replies

7. Shell Programming and Scripting

Passing commandline argument to a function

Hi, I have 2 ksh scripts. Script1.ksh contains function definition. script1.ksh function f1() { while getopts a:c: args do case $args in a) ARG1=$OPTARG ;; c) ARG2=$OPTARG ;; \?) echo "Error no valid Arguments passed" esac done echo $ARG1 echo $ARG2 script2.sh (2 Replies)
Discussion started by: siba.s.nayak
2 Replies

8. Shell Programming and Scripting

pass function as argument to a function

I have the following code : function1 () { print "January" } function2() { case $1 in January) print "Dzisiaj mamy styczen" ;; *) ;; } main() { (1 Reply)
Discussion started by: presul
1 Replies

9. Shell Programming and Scripting

passing argument from one function to another

Hi all, In the given script code . I want to pass the maximum value that variable "i" will have in function DivideJobs () to variable $max of function SubmitCondorJob(). Any help? Thanks #!/bin/bash ... (55 Replies)
Discussion started by: nrjrasaxena
55 Replies

10. Shell Programming and Scripting

Strange function call in the shell script parse_prog_args $@

I am converting shell script to Perl. In shell I have a code parse_prog_args() { if then while do case $1 in -P* | -p* ) export PROCESS_DATE=$2 export MM=`echo $2 | cut -c5-6` export DD=`echo $2 | cut -c7-8` export YY=`echo $2 | cut -c3-4` export... (4 Replies)
Discussion started by: digioleg54
4 Replies
scsi_reset(9F)						   Kernel Functions for Drivers 					    scsi_reset(9F)

NAME
scsi_reset - reset a SCSI bus or target SYNOPSIS
#include <sys/scsi/scsi.h> int scsi_reset(struct scsi_address *ap, int level); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
ap Pointer to the scsi_address structure. level The level of reset required. DESCRIPTION
scsi_reset() asks the host adapter driver to reset the SCSI bus or a SCSI target as specified by level. If level equals RESET_ALL, the SCSI bus is reset. If it equals RESET_TARGET, ap is used to determine the target to be reset. If it equals RESET_LUN, ap is used to determine the logical unit to be reset. When given the RESET_LUN level, scsi_reset() can return failure if the LOGICAL UNIT RESET message is not supported by the target device, or if the underlying HBA driver does not implement the ability to issue a LOGICAL UNIT RESET message. Note that, at the point when scsi_reset() resets the logical unit (case RESET_LUN), or the target (case RESET_TARGET), or the bus (case RESET_ALL), there might be one or more command packets outstanding. That is, packets have been passed to scsi_transport(), and queued or possibly transported, but the commands have not been completed and the target completion routine has not been called for those packets. The successful call to scsi_reset() has the side effect that any such commands currently outstanding are aborted, at which point the pack- ets are marked with pkt_reason set to CMD_RESET, and the appropriate bit -- either STAT_BUS_RESET or STAT_DEV_RESET -- is set in pkt_sta- tistics. Once thus appropriately marked, the aborted command packets are passed to the target driver command completion routine. Also note that, at the moment that a thread executing scsi_reset() actually resets the target or the bus, it is possible that a second thread may have already called scsi_transport(), but not yet queued or transported its command. In this case the HBA will not yet have received the second thread's packet and this packet will not be aborted. RETURN VALUES
scsi_reset() returns: 1 Upon success. 0 Upon failure. CONTEXT
scsi_reset() can be called from user or interrupt context. SEE ALSO
tran_reset(9E), tran_reset_notify(9E), scsi_abort(9F) Writing Device Drivers SunOS 5.10 12 Jul 2002 scsi_reset(9F)
All times are GMT -4. The time now is 08:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy