[HPADM] sed/script vi

From: Joe Crawford (abjcrawford@yahoo.com)
Date: Fri Mar 31 2006 - 12:06:19 EST


I Edit a .cshrc and put the following lines starting
at line 44:
# Fix for SHELL variable not set correctly
set SHELL_NAME=`echo ${SHELL} | awk -F/ '{print $NF}'`
test "X${SHELL_NAME}" != "Xtcsh" && \
test "X${SHELL_NAME}" != "Xcsh" && setenv SHELL
/usr/bin/csh
        I used following #!/bin/sh
sed '
{
44i\
set SHELL_NAME=`echo ${SHELL} | awk -F/ '{print $NF}'`
test "X${SHELL_NAME}" != "Xtcsh" && \
test "X${SHELL_NAME}" != "Xcsh" && setenv SHELL
/usr/bin/csh
}'

I run into a issue with sed and { Not sure what the
problem is?

OR Alternatively how would i add these using vi

vi .cshrc
:44
set SHELL_NAME=`echo ${SHELL} | awk -F/ '{print $NF}'`
test "X${SHELL_NAME}" != "Xtcsh" && \
test "X${SHELL_NAME}" != "Xcsh" && setenv SHELL
/usr/bin/csh
I mean to remove insert mode after adding the lines
what would be the syntax for using this with EOF?

Thanks

Joe

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:52 EDT