Microsoft
Software
Hardware
Network
Question : How to use dynamic variables in sed
how do i use dynamic variables in sed;
eg:
a=1
sed -ne '1p'
What if i wanted to use $a in the sed expression.
I dont know the syntax of it.
Answer : How to use dynamic variables in sed
I think you are using sh or bash.
sed -be 1p does exactly the same such as head -n 1
which is print the first line.
If you want to pas the number as variable, this:
a=1
sed -ne "$a"p filepath
would work. I tested.
Random Solutions
how to add swap partition to exsting swap in redhat linux
Mice seem to stop working frequently, tried multiple mice and USB ports
Mailman, the GNU Mailing List Manager - is there an interface to programmatically maintain email addrs?
added shortcut to Public Desktop but some users not getting it - Win 2008 R2 Terminal Server
How do I configure exchange 2007 to allow iPhone/iPad to work.
Auto fill user name in "Login" field
How to alter web page so Google Chrome will clear old data?
qmail ,mutt problem: Error sending message, child exited 127 (Exec error.).
how to truncate the transaction logs in exchange 2010 after NT backup
Need to Recover NT4 Domain Admin Password