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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Editing a file using a script

Status
Not open for further replies.

fidge

Technical User
Jun 11, 2003
20
GB
Hi,

I have a problem with a file containing "£". The file itself is created under oracle/Tru64 and transfered (ftp) to redhat linux. all this works fine, however when its pushed through a tomcat process it translates the "£" as "?". I've found a workaround and thats to vi and write quit the file. If I cp,cat,mv,sed the file it makes no difference.

What i'd like to find out is how to edit (vi) a file from within a script and <esc>:wq! it, and also if anybody knows why this is happening, it would solve my headache!

Thanks in advance
 
try this in a script:

ex /path/to/file <<eof_ex
w
q
eof_ex

'vi' is sort of a visual layer on top of 'ex' so perhaps this would work.

HTH,

p5wizard
 
Thanks P5wizard, thats works fine. Dont suppose you know why the char translation fails?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top