sed help
From: Bhavesh Shah (bshah_at_citadon.com)
Date: 10/12/05
- Previous message: Gosselin, Mark: "A little help, please?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 12 Oct 2005 12:39:37 -0700 To: <sunmanagers@sunmanagers.org>
Hi Gurus,
Sorry for the off topic. I am trying to get the script working but am
stuck. I tried googling and other unix forum but unable to get this
working so finally I turned to you gurus. I am struggling to get this
working since yesterday. If you can help me will be great help for me.
#! /bin/ksh
SOURCE=`cat source_file`
echo $SOURCE
sed '{
/insert/a\
'$SOURCE'
}' final_file > result_file
cat source_file
test1
test2
test3
cat final_file
insert
If source_file has only one line it works but multiple line fails with
sed error. The problem is my source_file is a variable and i can't put
it directly inside sed command.
Any help is greatly appreciated.
Sorry for the trouble.
Regards
B
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
- Previous message: Gosselin, Mark: "A little help, please?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]