harwooddale
Programmer
Hi,
I am having a problem passing a variable to the sed command.
For example:
$filename=13017105.ack
#I then want to count how many lines there are in the file,
#but need the output to be a number.
#The output looks something like:
#19 13017105.ack
#command to try and just retrieve number:
filename1=`wc -l $filename | sed 's/$filename//g'`
This doesn't work.
If I replace $filename with 13017105.ack it works perfectly!
Any Ideas
Any help appreciated
James
I am having a problem passing a variable to the sed command.
For example:
$filename=13017105.ack
#I then want to count how many lines there are in the file,
#but need the output to be a number.
#The output looks something like:
#19 13017105.ack
#command to try and just retrieve number:
filename1=`wc -l $filename | sed 's/$filename//g'`
This doesn't work.
If I replace $filename with 13017105.ack it works perfectly!
Any Ideas
Any help appreciated
James