On Sat, Sep 17, 2005 at 02:33:03PM -0500, Rodney Richison wrote: > Am trying to automate some stuff for future installs. > I'd like to echo multiple lines to the end of a file. Like this > > echo '. /etc/bash_completion' >> ~/.bashrc > > But I'd like to add multiple lines at one time. Like the ones below. I > realize I could cat them in from a text file, but I'd like to make this > script non-dependant of other text files. > > export LS_OPTIONS='--color=auto' > eval `dircolors` > alias ls='ls $LS_OPTIONS -F' > alias ll='ls $LS_OPTIONS -l' > alias l='ls $LS_OPTIONS -lA'
If I'm understanding you correctly, you probably want to use the so-called "here document" feature that virtually any shell provides. I.e., to append the above lines to 'somefile', you could write cat >>somefile <<"ENDOFQUOTE" export LS_OPTIONS='--color=auto' eval `dircolors` alias ls='ls $LS_OPTIONS -F' alias ll='ls $LS_OPTIONS -l' alias l='ls $LS_OPTIONS -lA' ENDOFQUOTE See the section "Here Documents" in the bash manpage for details (such as parameter expansion within the quoted text, etc.). Cheers, Almut -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]