- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- flush input buffer of terminal
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
05-09-2004 02:49 PM
05-09-2004 02:49 PM
flush input buffer of terminal
I have a scripts that execute a cmd at background using &. How do I flush the input buffer thereafter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2004 03:29 PM
05-09-2004 03:29 PM
Re: flush input buffer of terminal
Is that what you are looking for?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2004 03:35 PM
05-09-2004 03:35 PM
Re: flush input buffer of terminal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2004 03:47 PM
05-09-2004 03:47 PM
Re: flush input buffer of terminal
You will probably have to write a short program in C to call it and put the program in your path.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2004 03:47 PM
05-09-2004 03:47 PM
Re: flush input buffer of terminal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2004 03:53 PM
05-09-2004 03:53 PM
Re: flush input buffer of terminal
Is there a solution for this in ksh shell? My script is written in ksh scripting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2004 08:52 AM
05-10-2004 08:52 AM
Re: flush input buffer of terminal
Compile like this:
cc flushinput.c -o flushinput
Use it like this:
flushinput
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2004 09:46 AM
05-10-2004 09:46 AM
Re: flush input buffer of terminal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2004 11:59 AM
05-10-2004 11:59 AM
Re: flush input buffer of terminal
What cmd do you want to flush?
Please show example.
Some command do block buffering when it runs without terminal.(e.g. STDOUT is PIPE)
so, check cmd option that no buffering.
thx.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2004 10:02 PM
05-10-2004 10:02 PM
Re: flush input buffer of terminal
i have a legacy scripts which have this in the begining of the file. then some where in the middle of the file. it uses eval cmd to run another scripts. And in that scripts it call a program with &
the problm i have is that the scripts can return normally back. It go into some endless loop. when I take out & , it hang the screen. So i suspect it could be due to input buffer still holding some cmd causing the scripts to run infinitely.
trap 'maintain_configlist; return' 2 3 4 5 6 7 8 15
....
....
eval .
...
...
another scripts content:
/somedir/someprog/prog &
I can't paste it here cause it call multiple other file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2004 11:51 PM
05-10-2004 11:51 PM
Re: flush input buffer of terminal
eval .
or
somedir/someprog/prog < /dev/null &
or
insert "set -x" into head of prog or some scripts.
this option show command log.
thx.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2004 02:05 AM
05-11-2004 02:05 AM
Re: flush input buffer of terminal
if [ -t 0 ]
then
echo "Stdin is a tty device"
else
echo "Not"
fi
this will let your script bypass sections of code when it is not in an interactive environment. You also need to be careful when you have more than one process reading from a common file. The input will be interleaved among the competing processes and chaos is assured.