concatenate string in shell script

Bryan Sant bryan.sant at gmail.com
Thu Mar 16 12:23:18 MST 2006


On 3/16/06, Stuart Jansen <sjansen at buscaluz.org> wrote:
> #!/bin/sh
> file="/mnt/windows/My Documents/notes.txt"
> tensai="Corey"
> mesg="The world would be a better place"
> mesg="${mesg} if everyone listened to ${tensai}'s advice."
> echo "$mesg" >> "$file"
> mesg="${mesg/a better/an even better}"
> echo "${mesg/Corey/Stuart}" >> "$file"

Sweet.  Will this work with the Bourne shell?  Or does this only work
because sh is a link to bash?

-Bryan



More information about the PLUG mailing list