I have a file that I am manipulating in a Unix script. I want to use a sed command to insert text before the 1st line:
DATE $TDYSDATE //where $TDYSDATE is a variable set in
the script.
And I want to append text after the last line:
ENDOFFILE
This is what I've tried and it doesn't work:
#!/bin/ksh
cat test_file | sed '1i\DATE $TDYSDATE' \
'$a\ENDOFFILE' > new_file
I've tried numerous variations of this and I keep getting the same error - "Extra Text At End Of Command"
Please help.
DATE $TDYSDATE //where $TDYSDATE is a variable set in
the script.
And I want to append text after the last line:
ENDOFFILE
This is what I've tried and it doesn't work:
#!/bin/ksh
cat test_file | sed '1i\DATE $TDYSDATE' \
'$a\ENDOFFILE' > new_file
I've tried numerous variations of this and I keep getting the same error - "Extra Text At End Of Command"
Please help.