Korn shell help needed (keeping a changed file changed)

Korn shell help needed (keeping a changed file changed)

Post by David W. Tamk » Fri, 11 Mar 1994 05:10:35




| #!/bin/ksh
|
| usage: $0 file_2_change
|
| vi $1 << change_it
|   :%s/look/change/g    
| change_it
|
| #  After changing the input file, which I can see change on the screen,
| #  how do I get this changed file to stay changed once I leave the  
| #  korn shell invironment??

You aborted vi without saving the changes.  That's the problem.  It has
nothing to do with the shell environment.

vi $1 << \change_it
 :%s/look/change/g
 :wq
change_it

David W. Tamkin  P. O. Box 3284  Skokie IL  60076-6284

 
 
 

Korn shell help needed (keeping a changed file changed)

Post by Dave Fran » Fri, 11 Mar 1994 07:58:00



Quote:> #!/bin/ksh

> usage: $0 file_2_change

> vi $1 << change_it
>   :%s/look/change/g       #change all occurances of look to change
> change_it

> #  After changing the input file, which I can see change on the screen,
> #  how do I get this changed file to stay changed once I leave the  
> #  korn shell invironment??
> #
> #  Thanks in advance John

You forgot to do a ":wq" to write and quit.  You could also use "ex"
instead of "vi".