Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!sdd.hp.com!caen!news.cs.indiana.edu!att!pacbell.com!pacbell!ptsfa!jlwestm From: jlwestm@PacBell.COM (Jeff Westman) Newsgroups: comp.unix.shell Subject: Retaining file permissions Keywords: chmod, sed, awk Message-ID: <6039@ptsfa.PacBell.COM> Date: 21 Feb 91 19:51:42 GMT Organization: Pacific * Bell, San Ramon, CA Lines: 19 I have a script that replaces a string with another. The file is executable, but when I run it through 'sed' I loose the executable attribute -- and I don't want to change my umask. Here's basically what I have: # Replace one occurance with another print "Enter a \"from\" string: \c" ; read FROM print "Enter a \"to\" string: \c" ; read TO sed s/$FROM/$TO/gp $i > xyzyx mv -f xyzyx $i Any suggestions or improvements? -- Jeff Brought to you by Super Global Mega Corp .com