HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to get out from do/done , not from shell...
Operating System - HP-UX
1834299
Members
2110
Online
110066
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
10-24-2003 09:38 AM
10-24-2003 09:38 AM
Hi
I"m using pretty simple "while" to browse DATEFILE to find match, it could be in the middle of it, and I need to stop reading it if match occured. If I'm using "exit" I'm out of shell, but I need just to be out of do/done and go on with further statements:
Thanks
VMo
while read FMONTH FDATE
do
if [ $MONTH = "$FMONTH" ]; then
echo "$MONTH $FMONTH match match match"
SW="GOOD"
exit #!??????????????????
fi
done < ${DATEFILE}
echo "This is end of shell........."
I"m using pretty simple "while" to browse DATEFILE to find match, it could be in the middle of it, and I need to stop reading it if match occured. If I'm using "exit" I'm out of shell, but I need just to be out of do/done and go on with further statements:
Thanks
VMo
while read FMONTH FDATE
do
if [ $MONTH = "$FMONTH" ]; then
echo "$MONTH $FMONTH match match match"
SW="GOOD"
exit #!??????????????????
fi
done < ${DATEFILE}
echo "This is end of shell........."
beer or not beer
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2003 09:43 AM
10-24-2003 09:43 AM
Solution
break [n]
break exits from the smalles enclosing for, while, until, or select loop, or from the nth enclosing loop if you specify n. Execution continues with the command immediately following the loop(s). of course n is an integer greater then or equal to 1. default is 1.
break exits from the smalles enclosing for, while, until, or select loop, or from the nth enclosing loop if you specify n. Execution continues with the command immediately following the loop(s). of course n is an integer greater then or equal to 1. default is 1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2003 09:45 AM
10-24-2003 09:45 AM
Re: How to get out from do/done , not from shell...
MATCHED=0
while ! $MATCHED
do
while read FMONTH FDATE
do
if [ $MONTH = "$FMONTH" ]; then
echo "$MONTH $FMONTH match match match"
SW="GOOD"
MATCHED=1
fi
done < ${DATEFILE}
done
other stuff....
echo "This is end of shell........."
while ! $MATCHED
do
while read FMONTH FDATE
do
if [ $MONTH = "$FMONTH" ]; then
echo "$MONTH $FMONTH match match match"
SW="GOOD"
MATCHED=1
fi
done < ${DATEFILE}
done
other stuff....
echo "This is end of shell........."
Remember, wherever you go, there you are...
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP