- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Unix Shell Script - Input Trouble when trying to a...
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
06-08-2004 06:02 AM
06-08-2004 06:02 AM
Essentially, when I would like the script to do is enter keystrokes. If you could tell me how to do this, even if I have to use something else like Perl, I would be grateful.
-Bob Insley
current code:
#! /bin/ksh
vi temp
# what now?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2004 06:12 AM
06-08-2004 06:12 AM
Re: Unix Shell Script - Input Trouble when trying to act as keyboard
vi /tmp/temp << EOF
i hello world^[:wq!
EOF
You have to think like you are in the editor, but to go from input mode to command you use CONTROL-V ESC thus the ^[
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2004 06:16 AM
06-08-2004 06:16 AM
Re: Unix Shell Script - Input Trouble when trying to act as keyboard
echo "Hello world" > temp ?
Is there a reason why to use the vi specifically ??
Abdul.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2004 06:16 AM
06-08-2004 06:16 AM
Re: Unix Shell Script - Input Trouble when trying to act as keyboard
Invoking vi, in my opinion, is not a good idea.
I would rather use the echo command to get info into a file.
echo "hello world" > tempfile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2004 06:18 AM
06-08-2004 06:18 AM
Re: Unix Shell Script - Input Trouble when trying to act as keyboard
rm /tmp/temp
vi /tmp/temp << EOF
ihello world^[:1
:s/$/, this is great/
Gowow a line at the bottom^[:1
Oa line on top^[:2
oAfter hello world^[:wq!
EOF
more fun
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2004 06:21 AM
06-08-2004 06:21 AM
Re: Unix Shell Script - Input Trouble when trying to act as keyboard
And while we're at it, is there any way I can access obscure ascii characters?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2004 06:22 AM
06-08-2004 06:22 AM
Re: Unix Shell Script - Input Trouble when trying to act as keyboard
Thanks again,
bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2004 06:29 AM
06-08-2004 06:29 AM
Solution- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2004 06:30 AM
06-08-2004 06:30 AM
Re: Unix Shell Script - Input Trouble when trying to act as keyboard
The ultimate reason, if you care, is that I'm trying to write a program that will, among other things, open up netscape and navigate through an online document tracking system as instructed. I'm a long way, but thanks for helping me here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2004 06:32 AM
06-08-2004 06:32 AM
Re: Unix Shell Script - Input Trouble when trying to act as keyboard
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2004 06:40 AM
06-08-2004 06:40 AM
Re: Unix Shell Script - Input Trouble when trying to act as keyboard
That won't work for all other processes, which is why we use:
EXPECT & TCL & TK:
http://hpux.cs.utah.edu/hppd/hpux/Tcl/expect-5.41/
http://hpux.cs.utah.edu/hppd/hpux/Tcl/tcltk-8.4.6/
live free or die
harry