Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!ucsd!ames!haven!adm!smoke!ibd!heilpern From: heilpern@ibd.BRL.MIL (Mark A. Heilpern ) Newsgroups: comp.unix.questions Subject: Re: Help on control keys Message-ID: <235@ibd.BRL.MIL> Date: 3 Jan 89 14:28:39 GMT References: <893@husc6.harvard.edu> Reply-To: heilpern@brl.arpa (Mark A. Heilpern (IBD) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 43 In article <893@husc6.harvard.edu> yylu@walsh.UUCP (Ya Yan Lu) writes: > I am concerning the following program. Is it possible to put some >control characters in an ascii file, so that whenever I read that file >by cat or more, it actually runs a program? When cat or more are used, the >control keys in a file usually have some effect, but I am not so clear >what they really are. > Thanks for any help. Define program. If you are refering to a 'graphics' type of display, yes. It is not possible, however, to give a code that tells cat to execute the command rather than print it. {Unless you feel like rewriting /bin/cat. If you do, there is a genereic source of the 'normal' cat in comp.sources.} To create a graphics display that is catted, there are two basic options. Just like your old instructor from school, I will explain the hard one first. 1) a) get out the manual for your terminal and thoroughly study all Control codes and escape codes for graphics/movement. b) decide what you want to do and use 'cat >file' and start giving the codes to do what you want the screen to do. [You will not be able to give ^D, kill chars, etc., and the screen may start performing these results, so don't be discouraged if you can no longer see waht you are typeing. Just remember to use ^D on a line by itself to end input. c) cat the file and observe. Do Not Use More, as this will pause in unwanted areas. 2) [easy?] a) write a program using curses to perform your desired functions. b) run this program with redirected output: $ program > catfile c) cat catfile and the same display should be seen. -- |\/| | | | _ |< / \_(_(_)\_/ \______