Sponsored Content
Top Forums Shell Programming and Scripting Parsing a command line parameter in script Post 302548139 by g.pi on Wednesday 17th of August 2011 02:18:52 PM
Old 08-17-2011
could this be caused by the &parm in the last line? It should be $parm.

At the first glance, I don't believe what you are trying is going to work. But let's take 1 step at a time. Smilie Let me know once you have corrected the above issue.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Command Line width parameter

can someone please tell me how i can increase the number of characters that can be input on the command line? (2 Replies)
Discussion started by: Scoogie
2 Replies

2. Programming

Command line parameter for C program

I am writing a C program that part of the idea is to using a command line parameter to control not to run certain part of the sub program. I am totally new to C, I do not have any idea how to pass a command line arguments from a C program. Can anyone help ?! Thanks (3 Replies)
Discussion started by: Wing m. Cheng
3 Replies

3. Shell Programming and Scripting

using tab to finish command line parameter

Anyone know how to set it up so that when at command line in unix (specifically solaris 2.5.1), and you hit the tab it will finish the command with the nearest file that matches? AND how to set it up so using up and down arrows access your previous commands? Thanks for all the help here, i've had... (3 Replies)
Discussion started by: kymberm
3 Replies

4. Shell Programming and Scripting

replacing a string in a file with command line parameter

Hello, I am trying to replace a string with a paramter given along with the script. I am replacing application1 to application2 with the script: ./change_app.sh application2 change_app.sh: #!/bin/ksh grep $1 applications.dat 2>&1 >/dev/null echo $1 file=pckage.new sed 's/Name:... (5 Replies)
Discussion started by: chiru_h
5 Replies

5. Shell Programming and Scripting

Using the counter of a for loop in command line parameter

Say I have (in psuedocode) For i=1 to 10 tar cvfb /... 5*i /junk(i) end What I mean is that I want each successive for loop to have the block size parameter be 5 times the current counter. This isn't my actual code, just a stupid example...So the question is how do I descrive that parameter... (2 Replies)
Discussion started by: jeriryan87
2 Replies

6. Shell Programming and Scripting

How to compare a command line parameter with -- in shell scripting

Hi, I need to check if a parameter provided at the command line is equal to --.How can i do that ? Please help me. Thanks and Regards, Padmini (4 Replies)
Discussion started by: padmisri
4 Replies

7. Shell Programming and Scripting

How to get the last command line parameter?

"$#" gives the number of command-line arguments. How do you get the last command-line parameter (or any particular one determined by a variable)? I thought it would be "${$#}", but that produces something completely unexpected. (4 Replies)
Discussion started by: dkarr
4 Replies

8. Shell Programming and Scripting

perl script - command line parameter

i am a beginner, i want to make a program that takes any command line arguments... and print it out in reverse. ie. if the command line argument is "thanks for helping me" i want it to output "me helping for thanks" :D i have tried using the reverse command, but i cant get it working!! ... (3 Replies)
Discussion started by: bshell_1214
3 Replies

9. UNIX and Linux Applications

Passing date parameter on Kshell command line

I need to execute a .ksh from command line. The ksh calls a control file and has 3 parameters. First parameter is a csv file, second the target table in oracle and third parameter is a date parameter. I am attempting the below from the ksh command line {code} => testfile.ksh filname.csv... (1 Reply)
Discussion started by: kobe24
1 Replies

10. Shell Programming and Scripting

Parsing Command Line Arguments In C shell script

]I have a string like "/abc/cmind/def/pq/IC.2.4.6_main.64b/lnx86" and this string is given by user. But in this string instead of 64b user may passed 32 b an i need to parse this string and check wether its is 32b or 64 b and according to it i want to set appropriate flags. How will i do this... (11 Replies)
Discussion started by: codecatcher
11 Replies
putctl(9F)						   Kernel Functions for Drivers 						putctl(9F)

NAME
putctl - send a control message to a queue SYNOPSIS
#include <sys/stream.h> int putctl(queue_t *q, int type); INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI). PARAMETERS
q Queue to which the message is to be sent. type Message type (must be control, not data type). DESCRIPTION
putctl() tests the type argument to make sure a data type has not been specified, and then attempts to allocate a message block. putctl() fails if type is M_DATA, M_PROTO, or M_PCPROTO, or if a message block cannot be allocated. If successful, putctl() calls the put(9E) routine of the queue pointed to by q with the newly allocated and initialized messages. RETURN VALUES
On success, 1 is returned. If type is a data type, or if a message block cannot be allocated, 0 is returned. CONTEXT
putctl() can be called from user or interrupt context. EXAMPLES
Example 1: Using putctl() The send_ctl() routine is used to pass control messages downstream. M_BREAK messages are handled with putctl() (line 11). putctl1(9F) (line 16) is used for M_DELAY messages, so that parm can be used to specify the length of the delay. In either case, if a message block cannot be allocated a variable recording the number of allocation failures is incremented (lines 12, 17). If an invalid message type is detected, cmn_err(9F) panics the system (line 21). 1 void 2 send_ctl(wrq, type, parm) 3 queue_t *wrq; 4 uchar_t type; 5 uchar_t parm; 6 { 7 extern int num_alloc_fail; 8 9 switch (type) { 10 case M_BREAK: 11 if (!putctl(wrq->q_next, M_BREAK)) 12 num_alloc_fail++; 13 break; 14 15 case M_DELAY: 16 if (!putctl1(wrq->q_next, M_DELAY, parm)) 17 num_alloc_fail++; 18 break; 19 20 default: 21 cmn_err(CE_PANIC, "send_ctl: bad message type passed"); 22 break; 23 } 24 } SEE ALSO
put(9E), cmn_err(9F), datamsg(9F), putctl1(9F), putnextctl(9F) Writing Device Drivers STREAMS Programming Guide SunOS 5.10 11 Apr 1991 putctl(9F)
All times are GMT -4. The time now is 11:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy