SED and shell variables
Do you know how I can allow the shell to recognize the variable in this:
sed '$Variableq;d' files.txt ..where $Variable contains the line number to display |
Yeah, use double quotes (").
|
I've tried this but it doesn't work because its looking for a variable named $Variableq instead of $Variable
sed "$Variableq;d" files.txt |
oops. :)
Code:
sed "${Variable}q;d" files.txt |
Copied and pasted from your post but still not working. I get this error from SED..
sed: -e expression #1, char 1: unknown command: `'' I'm using GEdit and all other variables snow up as grey but the variable in this SED expression is pink (text/unknown). |
All times are GMT -5. The time now is 07:12 PM. |