![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 |
|
||||
|
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? |
|
||||
|
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
|
|
||||
|
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..... |
![]() |
| Bookmarks |
| Tags |
| solaris |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|