- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Carriage Return in a 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-03-2007 02:06 AM
01-03-2007 02:06 AM
I have a question, perhaps one of you can give me an idea of what to do. We are running
Informix 7.3.1UD8 Online Engine,
I have a script I’ve been running manually arch_pei.sh
# cat arch_pei.sh
#!/bin/sh
cd /snapfileserver2
mv level0.pei old.level0.pei
touch level0.pei
chown informix:informix level0.pei
chmod 660 level0.pei
ontape -s -L 0
rm old.level0.pei
#
FWIW the line "ontape -s -L 0" in the script prompts for a mount
Please mount tape 1 on /snapfileserver2/level0.pei
the file and location in question is disk and not tape.
When I run this I am prompted to enter a carriage return at the ONTAPE LINE . How with in this script can I echo or force a carriage return to run this script? Should I use expect?
If any one wth Informix experience sees this they may have a work around.. I'd appreciate it.
Rex Mueller - Educational Service Unit #3
Omaha, NE
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2007 02:13 AM
01-03-2007 02:13 AM
Re: Carriage Return in a script -
how about something along these lines:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=971561
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2007 02:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2007 02:35 AM
01-03-2007 02:35 AM
Re: Carriage Return in a script -
I'm not familiar with 'ontape', but perhaps this would work:
...
chmod 660 level0.pei
ontape -s -L 0 << _EOF_
_EOF_
rm old.level0.pei
...
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2007 02:53 AM
01-03-2007 02:53 AM
Re: Carriage Return in a script -
Omaha,
Check this out:
You can use the below ,Hope this can help,
echo "\r" | ontape -s -L 0
That will provide a carriage retrun after it will ask after doing intital process by ontape ,
Cheers,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2007 02:53 AM
01-03-2007 02:53 AM
Re: Carriage Return in a script -
Omaha,
Check this out:
You can use the below ,Hope this can help,
echo "\r" | ontape -s -L 0
That will provide a carriage retrun after it will ask after doing initial process by ontape ,
Cheers,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2007 02:56 AM
01-03-2007 02:56 AM
Re: Carriage Return in a script -
Omaha,
Also you can do like this :
# echo "\r" | ./arch_pei.sh
That will add a carriage when it will prompt,
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2007 05:40 AM
01-03-2007 05:40 AM
Re: Carriage Return in a script -
< /dev/null
and the
echo "\r" worked, I didn't try the others.. Appreciate the assist.
I didn't think I'd have to resort to writting an expect script to handle something as simple as a carriage return!
Thanks !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2007 06:03 AM
01-03-2007 06:03 AM
Re: Carriage Return in a script -
Well , sorry! for the multiple posting happend due to itrc site access problem and due to multiple click,. Hope you understood that.
And nice to know that the script worked.
Enjoy,Cheers,
Raj.
(ps: 0 pts pls)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2007 09:10 PM
01-07-2007 09:10 PM
Re: Carriage Return in a script -
could you please confirm that you read the answers provided in the link in my first post ?
Solutions given in that link were:
expect and/or redirct of input (use of <<)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2007 12:59 AM
01-08-2007 12:59 AM
Re: Carriage Return in a script -
Yes, I did read the other thread.. I've been using Expect for many other things.. However for this "issue" I felt it was not merited to use it at this point.
I do keep references to refer back to when I script. My brain doesn't always recall things like it used to 10 years ago. :D
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2007 01:11 AM
01-08-2007 01:11 AM
Re: Carriage Return in a script -
did you also read on in that link and see Steve Lewis's solution - which was the use of << EOF
Rather than just answering a particular problem with a one-liner I try to find a previous thread which suggests a number of solutions, as users tend to have preferences.
In this case, the use of << was one answer (as also offered by Spex). You mentioned expect as a possible solution in your description.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2007 01:20 AM
01-08-2007 01:20 AM
Re: Carriage Return in a script -
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2007 01:23 AM
01-08-2007 01:23 AM