Hi, i need help passing variables to sed using ksh.
My goal is to get particular data from log files.
first i put a mark to the log files.
echo "TEST_"`date + %m_%d_%Y_%T"` >markFile
this will produce a 'markFile' which contain text like this
TEST_06_01_2009_21:55:09
then i put the mark in the beginning and the end of a test on file.log
cat markFile>>file.log
...
...Let the test run
...
cat markFile>>file.log
as a result the log file will look like this
some text 1...
some text 2...
TEST_06_01_2009_21:55:09
some text 3...
some text 4...
some text 5...
TEST_06_01_2009_21:55:09
some text 6...
some text 7...
some text 8...
now i need to take the lines between those marks
TEST_06_01_2009_21:55:09
some text 3...
some text 4...
some text 5...
TEST_06_01_2009_21:55:09
as i said i am using ksh
create a variable
mark=`cat markFile`
sed -n '/$mark/,/$mark/p' acu.log
the issue is in the sed... sed doesn't want to take the value of $mark. i think sed sees $mark as a command.