- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: "Return" in a 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
01-29-2002 12:29 PM
01-29-2002 12:29 PM
"Return" in a shell script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2002 12:33 PM
01-29-2002 12:33 PM
Re: "Return" in a shell script.
Your question is very unclear. Do you want to exit with a given value (e.g) exit 2; do you want to print values to stdout?; or do you want to echo Carriage Returns via echo "\r\r\c"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2002 12:37 PM
01-29-2002 12:37 PM
Re: "Return" in a shell script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2002 12:37 PM
01-29-2002 12:37 PM
Re: "Return" in a shell script.
Do you want/mean "return" as in linefeed?...then:
# echo "bye!\n"
Or do you mean 'break' one or more time from a loop control?
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2002 12:40 PM
01-29-2002 12:40 PM
Re: "Return" in a shell script.
...like this:
# echo "Press ENTER when ready!"
# read BITBUCKET
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2002 12:41 PM
01-29-2002 12:41 PM
Re: "Return" in a shell script.
I mean at a certain point in this script, the script is waiting for the user to hit the "enter" key, I want this action to be aoutmatic!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2002 12:49 PM
01-29-2002 12:49 PM
Re: "Return" in a shell script.
Plan B. Look into a utility called 'Expect'. You can get it from any of the HP-UX Porting Centre's. With Expect, you can specify patterns to look for and then the appropriate response. If all you need are a couple of LF's CR's then simply echo will work just fine.
Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2002 01:15 PM
01-29-2002 01:15 PM
Re: "Return" in a shell script.
If you're certain you want to always answer the replies with
process <
EOF
Hopefully this show up as 2 blank lines between the start of input redirection (<
Put nothing else on between these 2 lines. The ending EOF needs to start in column 1.
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2002 05:47 PM
01-29-2002 05:47 PM
Re: "Return" in a shell script.
Maybe you can try this:
echo "Press enter to continue..."
ans=`line -t 5`
It will continue after 5 seconds without press the enter key.
Hope this helps.
Kenny.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2002 06:02 PM
01-29-2002 06:02 PM
Re: "Return" in a shell script.
If the program does not understand redirected stdin, then the freeware program expect may be a solution. Don't try to test the command in the script until you get it to work from the command line. And be sure that if the program requires a special environment, it must be set in the script (cron has almost nothing in the environment).
Bill Hassell, sysadmin