- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: "GOTO" in a korn shell script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2002 11:03 AM
09-25-2002 11:03 AM
I have a ksh script that has me stumped. I have added an "if-then-else-fi" around some existing code that used to all run unconditionally, and now I've created a problem. Can it be the here file ( << endofsort) causing the problem? As always, I appreciate your help. I haven't stumped you yet:-)
This is the block of code that has the problem:
if [[ $_pass1 = "1" ]]
then
syncsort 2>> testfile << endofsort
/infile pas1800.dbasub00 fixed 240
/infile ps2001p.p27510 fixed 240
/fields f1 1 131 character
/keys f1
/outfile pas1800.dbasub00.pass1.memo fixed 240
/statistics
/end
endofsort
export RTNCODE=`echo $?`
echo Return code is $RTNCODE >> testfile
case $RTNCODE in
0) ;;
*) echo $STEP TERMINATED ABNORMALLY !!!!!!!!!! |tee -a testfile
echo Error Code $RTNCODE |tee -a testfile
exit $RTNCODE ;;
esac
#
else
cp pas1800.dbasub00 pas1800.dbasub00.pass1.memo
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2002 11:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2002 11:19 AM
09-25-2002 11:19 AM
Re: "GOTO" in a korn shell script
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2002 11:27 AM
09-25-2002 11:27 AM
Re: "GOTO" in a korn shell script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2002 11:33 AM
09-25-2002 11:33 AM
Re: "GOTO" in a korn shell script
/No_Points_Please/
I like pretty, rigourously indented code too, but this is one case where you have to abide by a "higher rule" :-)
Glad to have been of help.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2002 12:08 AM
09-26-2002 12:08 AM
Re: "GOTO" in a korn shell script
Example:
cat <<- EOF
hello 1
hello 2
EOF
produces
hello 1
hello 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2002 05:35 AM
09-26-2002 05:35 AM
Re: "GOTO" in a korn shell script
Thanks for the additional info. I checked the man page (ksh - TRU64 Unix) and found that the "-" just strips off tabs from the beginning of the here document and not all white space. With tabs, it works like a champ.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2002 05:41 AM
09-26-2002 05:41 AM
Re: "GOTO" in a korn shell script
Keep in mind that this works WITH TABS ONLY; not spaces.