Retaining file permissions

Jeff Westman jlwestm at PacBell.COM
Fri Feb 22 06:51:42 AEST 1991


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
        



More information about the Comp.unix.shell mailing list