What could be the issue ?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting What could be the issue ?
# 22  
Old 04-02-2014
Thanks, it worked.

I ran the script and it worked.

Executed like below
Code:
./fu.sh QM.HOME MQ123 CL555

Can we add multiple clusters at a time. like below

Code:
./fu.sh QM.HOME MQ123 CL555,CL666,CL777

clusters were seperated by " , ". or we can use any symbol to separate clusters.

so if we give like above can it add CL555,CL666,CL777 at a time?
# 23  
Old 04-02-2014
Because the command arguments are space-separated, a string like CL555,CL666,CL777 goes to the $3 parameter,
so should work.
The $3 parameter can even contain space characters if passed in quotes:
Code:
./fu.sh QM.HOME MQ123 "CL555, CL666, CL777"

In the shell code (but not in the awk code!) the $3 must be quoted "$3", otherwise the shell would break it into words.
# 24  
Old 04-02-2014
I got two issues
1.
I am getting an error when there are " small letters " in NL.
So we need to keep NL in ' ' always. I tried to put ' ' at nl but it didn't work

Code:
print "ALTER", 'nl', s0, "DESCR (", descr, ")"; exit

2.and got below error

Code:
./alternamelist.sh: line 10: nawk: not found


Last edited by darling; 04-02-2014 at 06:34 AM..
# 25  
Old 04-06-2014
if NL value is
Code:
 CL.ROMt1

when we running script i am getting
Code:
CL.ROMT1 not found. It taking all the values as Capital.

# 26  
Old 05-01-2014
Hi,
I have below script to alter the NL, but when it is altering it should take "NL" value into single quotes like below

alter nl('$NL') but now below script is doint with out single quotes alter nl($NL), where to modify below script to put NL value in single quotes '' ?

Code:
#!/bin/ksh
if [ $# != 3 ]
then
echo usage: alterNamelist.sh QMGR MQREQ NAME
fi

NL=`echo 'dis qmgr'|runmqsc $1|grep REPOSNL|sed 's/.*REPOSNL\(.*\).*/\1/' |cut -d'(' -f2|cut -d')' -f1`

echo 'define nl('$NL'_'$2') like('$NL')'|runmqsc -e $1
echo 'dis nl('$NL') names ' | runmqsc $1 | nawk '
$1~/^NAMELIST ?\(/ {nl=$0}
$1~/^NAMES ?\(/ {a=1}
a==1 {
  s0=s0 "+\n" $0
  if (/\)/) {
sub( /\)/, ","addname"\)", s0)
print "ALTER", nl, s0, "DESCR (", descr, ")"; exit
  }
}' addname="$3" descr="$2" | runmqsc -e $1

For information above script is doing below thing
alter nl($NL) names(1, 2, 3,etc...)
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Issue with wc -c and wc -m

Hi All, I have a small queries to get the character count i tried with wc -c and wc -m but its not returend current result For eg: wc -c wc -m echo "Name" | wc -c result: 5 but actually it should returned 4 Help me on this to ge the correct one. Thanks! ----------... (4 Replies)
Discussion started by: siva.pitchai
4 Replies

2. Shell Programming and Scripting

Variable value substitution issue with awk command issue

Hi All, I am using the below script which has awk command, but it is not returing the expected result. can some pls help me to correct the command. The below script sample.ksh should give the result if the value of last 4 digits in the variable NM matches with the variable value DAT. The... (7 Replies)
Discussion started by: G.K.K
7 Replies

3. Shell Programming and Scripting

Need assistance with a file issue and a terminal issue

Hello everyone, I'm in need of some assistance. I'm currently enrolled in an introductory UNIX shell programming course and, well halfway through the semester, we are receiving our first actual assignment. I've somewhat realized now that I've fallen behind, and I'm working to get caught up, but for... (1 Reply)
Discussion started by: MrMagoo22
1 Replies

4. Shell Programming and Scripting

CP Issue

I want to copy large amount of files aproximately more than 20,000 files from one file system to another file system, but it gives me error like: #cd /opt/appserver/images #cp * /opt/appserver02/public/images Argument list is too long Also above mention error appear again when i run: ... (1 Reply)
Discussion started by: telnor
1 Replies

5. Solaris

IP issue

hi , I have a Solaris server which is part of a domain. The IP for this Solaris box is allocated dyanamically by a DHCP. Everytime the solaris box is restarted the IP gets changed. Being an admin what should i do to find the new ip of the Solaris server sitting at my location? Till now i get... (2 Replies)
Discussion started by: BalajiUthira
2 Replies

6. UNIX for Dummies Questions & Answers

ISSUE and ISSUE.NET files

In LINUX(CentOS, RedHat) is there a way to have the banner statement appear before the logon instead of after the logon? In UNIX and Windows the banner appears before a person actually logs on, what I'm seeing in LINUX is that it appears after the login(ftp, telnet, SSH). Thanks (0 Replies)
Discussion started by: ejjones
0 Replies

7. Shell Programming and Scripting

hi all please help me in this issue.

Hi all, I am very new to shell scripting.I have the requirement like one program is there, if it is running leave like that only and if it is stopped it has to be restart and once again keep watching and it is stopped we a have to restart once agian.I want a shell script for this.Please help me... (10 Replies)
Discussion started by: bhas85
10 Replies

8. Shell Programming and Scripting

Unix Arithmatic operation issue , datatype issue

Hi, I have a shell scripting. This will take 7 digit number in each line and add 7 digit number with next subsequent lines ( normal addition ). Eg: 0000001 0000220 0001235 0000022 0000023 ........... ......... ........ Like this i am having around 1500000 records. After adding... (23 Replies)
Discussion started by: thambi
23 Replies

9. UNIX for Dummies Questions & Answers

ps issue

HI All, Suddenly don't know what happened to redhat linux 7.2 any program start then itsn't listing while using ps -ef ex: ./xyz this xyz program pid not showing in ps-ef Pls let me know what is the reason for the same. Thanks a lot in advance Bache (7 Replies)
Discussion started by: bache_gowda
7 Replies
Login or Register to Ask a Question