need help on korn passing param


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting need help on korn passing param
# 1  
Old 03-25-2008
need help on korn passing param

Hi,

I need to script this:

lsvg -l vg10|grep -v vg10:|grep -v LV|awk '{print "chlv -u 2 ",$1}' > script_vg10.sh

So that I could just pass the parameter of the volume group.

When I did this on a script:

#!/bin/ksh
lsvg -l %1|grep -v %1:|grep -v LV|awk '{print "chlv -u 2",$1}' > script_%1.sh

I got this error (with param of vg10):

0516-306 lsvg: Unable to find volume group %1 in the Device
Configuration Database.

Thank you in advance,
Itik
# 2  
Old 03-25-2008
%1 is a DOS parameter. Too much u$-DOG scripting lately?

In Bourne-compatible shells, the parameters are $1 $2 $3 etc.

As an aside, the complex grep | grep | awk should probably be refactored. Something like

Code:
lsvg -l $1 | awk "!/($1|LV)/‚ print "chlv -u 2, $1" }'

# 3  
Old 03-25-2008
I just need to change the % to $. Your script got error...

thanks

Last edited by itik; 03-25-2008 at 01:59 PM..
# 4  
Old 03-25-2008
Quote:
You're script got error...
Yeah, I noticed. Sorry about that. (You're grammer gotz bigg bigg error too man!)

Code:
lsvg -l $1 | awk '!/('"$1"'|LV)/ { print "chlv -u 2", $1 }'

# 5  
Old 03-25-2008
Thanks. It's fixed too.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Dynamics param for script

Hi everyone, I need a way to take the value of a parameter with a for lood. For example i execute the script with this parameter ./Script PARAM1 PARAM2 PARAM3 PRAM4 for i in <LIST OF PARAMETERS> do PARAMETERS=$<NUMBER OF PARAMETER> done How can i express <LIST OF... (1 Reply)
Discussion started by: Xedrox
1 Replies

2. Web Development

CGI param() function parameters

Hello again! Three posts in this forum now, as I am trying to understand how CGI is running and the interaction of the input and output with the server/browser. Very confused with them, especially with the param() function that I was trying to figure out how the parameters of it were passed in... (0 Replies)
Discussion started by: yifangt
0 Replies

3. Shell Programming and Scripting

check for param values

I need to check for 4ht parameter values, if they are not in (17,18) in other words if they r not equal to 17 or 18 then exit. can u help pls (4 Replies)
Discussion started by: raopatwari
4 Replies

4. Shell Programming and Scripting

Passing text to RCS prompts in KORN script,

Hopefully someone can help here. I have a script written in korn by a former employee and I am trying modify it. Most of the script works except when we run it and pass the tesxt 'unlock' as a parameter when we want to unlock a file in RCS (revision control system). When we run this script and use... (2 Replies)
Discussion started by: pjones0066
2 Replies

5. UNIX for Dummies Questions & Answers

sqlplus script out param

For starters, I have read the forums from top to bottom and cannot find a solution to this particular scenario. Just finished up two hours or scouring the archives. Here is my question which has been asked numerous times before but never fully explained for this particular solution: How do I pass a... (2 Replies)
Discussion started by: jwil0m0
2 Replies

6. Shell Programming and Scripting

param as current date+time

Hi All, I need to pass param on aix "errpt -a -s MMDDHHMMYY -e MMDDHHMMYY". How do I read the date+time on the system and pass it as parameter? I need also the -s as previous day and the -e as current day. Thanks, itik (1 Reply)
Discussion started by: itik
1 Replies

7. Shell Programming and Scripting

param with awk

Hi All, I have this script: #!/bin/ksh lsvg -l $1|grep -v $1:|grep -v LV|awk '{print "mklvcopy ",$1," 2 $2 $3"}' I want to pass three param with "vg2 hdisk1 hdisk2" but the output is "mklvcopy lv1 2 $2 $3". I want to pass the hdisk1 and hdisk2 and not the $2 and $3. Please help! ... (3 Replies)
Discussion started by: itik
3 Replies

8. UNIX for Advanced & Expert Users

param with awk

Hi All, I have this script: #!/bin/ksh lsvg -l $1|grep -v $1:|grep -v LV|awk '{print "mklvcopy ",$1," 2 $2 $3"}' I want to pass three param with "vg2 hdisk1 hdisk2" but the output is "mklvcopy lv1 2 $2 $3". I want to pass the hdisk1 and hdisk2 and not the $2 and $3. Please help! ... (1 Reply)
Discussion started by: itik
1 Replies

9. HP-UX

kernel param listings

Which shows the current kernel settings accurately? kmtune or sysdef. I ask because although some params show the same setting with both, some do not. Example >kmtune | grep nfile nfile 75008 - (15*NPROC+2048) >sysdef | grep nfile nfile 75018 ... (6 Replies)
Discussion started by: theninja
6 Replies

10. UNIX for Dummies Questions & Answers

capturing oracle procedure out param value

I have a procedure with an out parameter, I want to use this value in a shell script, I've done this in perl before but they want this to be a ksh script. what is the syntax to do this. this was my first thought; #!/usr/bin/ksh sqlplus -s scott/tiger@db << EOF ... (1 Reply)
Discussion started by: edog
1 Replies
Login or Register to Ask a Question