The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Bourne-again shell mrsamer UNIX for Dummies Questions & Answers 3 09-30-2006 02:42 AM
Bourne Shell and Arrays Unbeliever Shell Programming and Scripting 2 07-25-2005 10:48 AM
Bourne Shell scripting help PoloRL185 Shell Programming and Scripting 1 05-13-2005 12:09 PM
Bourne Shell Script dmhonor914 UNIX for Dummies Questions & Answers 2 12-10-2003 12:25 PM
Bourne Shell Scripting Slamo Shell Programming and Scripting 3 05-19-2003 08:52 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-16-2004
gillbates gillbates is offline
Registered User
  
 

Join Date: Mar 2002
Location: DC
Posts: 46
bourne shell not working

This code has worked for years and still does in my production environment. But it's failing in my development environment now. The cd works but the creation of node1, jnum, and node2 fails. Oddly the output shows a line from from the awk script at the end of the code during the setting of each of those three vars. The output is shown after the code. Does anyone have any idea what's going on? This is run under solaris. Thanks?






cd $LF_WORK_DIR
node1=`echo ${lcFile8} | awk '{print "G" substr($0,1,7)}' | tr '[a-z]' '[A-Z]'`
jnum=`echo ${node1} | awk '{i=length($0)-2;if(i<1)i=1;print substr($0,i,3)}' | tr '[a-z]' '[A-Z]'`
node2=`echo ${lcFile8} | awk '{print "S" substr($0,8,1)}' | tr '[a-z]' '[A-Z]'`
netrcFile=${LF_WORK_DIR}/${inputFile}.netrc
#
# reset the destination to the IBM
#
GEO_CMD="${LF_HOME}/.netrc_CMDS_${IBM_TARGET}_$$"
${LF_BIN_DIR}/LF_remove.sh NOWARN ${GEO_CMD} ${netrcFile}
#
# Create sed commands to edit the jcl
#
if [ ${exitCd} -lt 1 ]; then
sort ${workFile} ${outQMS} | awk -f ${LF_BIN_DIR}/LF_Merge_Geodata.awk > ${mergeIBM}







cd /appl/lfdevl/lfadmd/work
+ echo 00317909
+ tr [a-z] [A-Z]
+ awk {print "G" substr($0,1,7)}
awk: BEGIN: execute permission denied
awk: }: execute permission denied
awk: syntax error at line 3: `loanNum=substr' unexpected
node1=
+ echo
+ echo
+ tr [a-z] [A-Z]
+ awk {i=length($0)-2;if(i<1)i=1;print substr($0,i,3)}
awk: BEGIN: execute permission denied
awk: }: execute permission denied
awk: syntax error at line 3: `loanNum=substr' unexpected
jnum=
+ echo
+ echo 00317909
+ tr [a-z] [A-Z]
+ awk {print "S" substr($0,8,1)}
awk: BEGIN: execute permission denied
awk: }: execute permission denied
awk: syntax error at line 3: `loanNum=substr' unexpected
node2=
+ echo
netrcFile=/appl/lfdevl/lfadmd/work/00317909.geo.netrc
GEO_CMD=/appl/lfdevl/lfadmd/.netrc_CMDS_fmaenje_21636
+ /appl/lfdevl/lfadmd/bin/LF_remove.sh NOWARN
+ /appl/lfdevl/lfadmd/.netrc_CMDS_fmaenje_21636 /appl/lfdevl/lfadmd/work/00317909.geo.netrc
+ [ 0 -lt 1 ]
+ awk -f /appl/lfdevl/lfadmd/bin/LF_Merge_Geodata.awk
  #2 (permalink)  
Old 06-16-2004
google's Avatar
google google is offline Forum Advisor  
Moderator
  
 

Join Date: Jul 2002
Location: Atlanta
Posts: 740
Its pretty obvious that there is a permissions problem here. Did the sysadmin recently change permissions (or update) the awk binary? Did your group change? Also, check to see that you have the appropriate permissions on this directory cd /appl/lfdevl/lfadmd/work as well.

This block is suspect as well
Code:
if [ ${exitCd} -lt 1 ]; then
sort ${workFile} ${outQMS} | awk -f ${LF_BIN_DIR}/LF_Merge_Geodata.awk > ${mergeIBM}
fi
You are missing an end if fi
  #3 (permalink)  
Old 06-16-2004
gillbates gillbates is offline
Registered User
  
 

Join Date: Mar 2002
Location: DC
Posts: 46
reply from Gill Bates

I'll have to go along with your first point.

I'm not sure about your second point. Do sysadmins go around breaking the awk binary? That would explain this.

To your third point, no my group hasn't changed but my company did hire an auditing group that has required all kinds of changes that were probably needed but have made life difficult.

As to your forth point I own that directory.

To your final point it's there I just didn't share it.

I thank you for your time and any other thoughts you may wish to share.

Gill

Can you explain why that string 'loanNum=substr' which comes from the awk script at the end of the code shows up in each of the three variable assignments?
  #4 (permalink)  
Old 06-17-2004
gillbates gillbates is offline
Registered User
  
 

Join Date: Mar 2002
Location: DC
Posts: 46
update

I figured it out. I think someone must be messing with me. I moved the assignment statements up in the code and they started working fine. The awk statements afterwards still failed. So I started looking at a java call that preceded the errors. It looked fine but it was resetting the path and placing my bin directory at the start. Sure enough there was a script called awk that contained the LF_Merge_Geodata.awk script. So everytime I called awk after the path was reset I'd get that message. Live and learn. Thanks, Gill
  #5 (permalink)  
Old 06-17-2004
dangral dangral is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2002
Posts: 699
So your name is really gill bates?!
  #6 (permalink)  
Old 06-17-2004
gillbates gillbates is offline
Registered User
  
 

Join Date: Mar 2002
Location: DC
Posts: 46
No, I quess you would call it a pseudonym. How about you? Is your name dangral? I did add my real location thought. Greg
  #7 (permalink)  
Old 06-17-2004
dangral dangral is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2002
Posts: 699
What threw me off a bit was that you signed your post as Gill.I figured you would have signed as gillbates.

Most people on this board either sign with their real first name or their full alias.
It's not that unlikely that your name would really be gill bates. Just a funny coincidence.


Anyhow.....
Closed Thread

Bookmarks

Tags
solaris

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:20 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0