Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

beginfile

Status
Not open for further replies.

ng1

Technical User
Aug 22, 2007
39
US
Is there a unix equivalent to :beginfile and :endfile

For example, I am doing some editing with qedit. I want everything that is output from the qedit program to end up in a file. We are using HPUX (and this script would be run inside of a batch script and not manually) so it would look something like this:

beginfile SCRIPT

LIVE $ + qedit
qux/TEXT TEST
'Language' is now DATA
6 lines in file
qux/D 1/4
1 _444
2 _555
3 _555
4 _666
4 lines Deleted!
qux/KEEP
/var/summit/spectrum/LIVE/FI/DATA/TEST #Records = 6
Purge existing file [no]? Y
Existing file Purged!
Keep /var/summit/spectrum/LIVE/FI/DATA/TEST
2 lines saved
qux/EXIT

endfile

Therefore, the file SCRIPT would contain

LIVE $ + qedit
qux/TEXT TEST
'Language' is now DATA
6 lines in file
qux/D 1/4
1 _444
2 _555
3 _555
4 _666
4 lines Deleted!
qux/KEEP
/var/summit/spectrum/LIVE/FI/DATA/TEST #Records = 6
Purge existing file [no]? Y
Existing file Purged!
Keep /var/summit/spectrum/LIVE/FI/DATA/TEST
2 lines saved
qux/EXIT



 
In your shell man page have a look at I/O redirection.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top