bourne shell not working


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting bourne shell not working
# 1  
Old 06-16-2004
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  
Old 06-16-2004
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  
Old 06-16-2004
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  
Old 06-17-2004
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  
Old 06-17-2004
So your name is really gill bates?!
# 6  
Old 06-17-2004
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  
Old 06-17-2004
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.....
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

For loop in bourne shell is not working

I have a loop with cases I am working on Bourne shell for file in *.${Today}*.csv *.${Today}*.txt\ do case ${file} in sun_detail) do something ;; sum) do something ;; mod) do something ;; *) do something ;; (5 Replies)
Discussion started by: digioleg54
5 Replies

2. Solaris

Alias is not working under Bourne Shell

Hi, Please assist me why HC alias is not working under this shell? root@singapore # grep HC /.profile alias HC='cd /var/tmp/HC/2015/`date +%B`' root@singapore # . /.profile Sourcing //.profile-EIS..... root@singapore # echo $HC root@singapore # HC HC: not found root@singapore # echo... (18 Replies)
Discussion started by: tprabhu1983
18 Replies

3. Cybersecurity

'Shell Shock' vulnerability in Bourne shell

A severe vulnerability was discovered in Bourne shell. Just google for: bash vulnerability ... for more details. (5 Replies)
Discussion started by: Cochise
5 Replies

4. UNIX for Dummies Questions & Answers

Bourne shell tutorial

hey guys, what is prolly the best way to learn bourne shell programming the easy way? I found many tutorials but I just cant seem to decide / chose which one is the best and suits my needs. could you recommend me some tutos? thanks (1 Reply)
Discussion started by: genius90
1 Replies

5. Shell Programming and Scripting

Bourne shell & Korn shell

Could some one tell me the difference btw Bourne shell and the Kshell? Which is more flexible and reliable in terms of portability and efficiency. When i type the following command .. $ echo $SHELL yields me /bin/sh Does this tells me that I am in Bourne shell. If yes, how can i get... (6 Replies)
Discussion started by: bobby1015
6 Replies

6. Shell Programming and Scripting

Bourne/C shell help

Exercise Five Write a Bourne shell script which: • Professionalism: plan for this from the start. • Has one command line argument. • If the command line argument is a directory then the script should output the number of files in the directory. • If the command line argument is an ordinary... (2 Replies)
Discussion started by: moesom
2 Replies

7. Shell Programming and Scripting

How to activate Korn Shell functionnalities in Bourne Shell

Hi All I have writing a Korn Shell script to execute it on many of our servers. But some servers don't have Korn Shell installed, they use Borne Shell. Some operations like calculation don't work : cat ${file1} | tail -$((${num1}-${num2})) > ${file2} Is it possible to activate Korn Shell... (3 Replies)
Discussion started by: madmat
3 Replies

8. Shell Programming and Scripting

I need to understand the differences between the bash shell and the Bourne shell

I do not claim to be an expert, but I have done things with scripts that whole teams of folks have said can not be done. Of course they should have said we do not have the intestinal fortitude to git-r-done. I have been using UNIX actually HPUX since 1992. Unfortunately my old computer died and... (7 Replies)
Discussion started by: awk_sed_hello
7 Replies

9. UNIX for Dummies Questions & Answers

Bourne-again shell

Hi guys !! well i'm still new in learning UNIX , and actually i'm still studying it by myself .. anyway, some people told me the Bourne-again shell is a good version of UNIX to work on , and i tried to download yesterday but i didn't know how to start it ...... the ReadMe file associated with... (3 Replies)
Discussion started by: mrsamer
3 Replies

10. UNIX for Dummies Questions & Answers

Bourne Shell Script

Hello, I'm throwing this out there as a novice to the Unix world...I've been working on a project that requires me to ouput (using the echo command) a list of names in a single column format, but the problem is the input is in row format followed by a blank space...If anyone could give me a... (2 Replies)
Discussion started by: dmhonor914
2 Replies
Login or Register to Ask a Question