Jean-Louis Crouzet wrote:
Jochen Schulz wrote:
Jean-Louis Crouzet:
#cat sip.conf | grep -v "^;"
That's a useless use of cat. :) You may instead just do
grep -v '^;' sip.conf
If you want to strip empty lines and lines beginning with whitespace
followed by a ';' as well, do
grep -E -v '(^\s*;)|^\s*$'
J.
OK thanks for the tip now running. I still need display line such as
bindport=5060 ; UDP Port to bind to (SIP standard port
is 5060)
but not line such as
; Set this to your host name or domain name
Try this:
grep -v '^\s*;\|^\s*$'|sed -e 's/;.*$//'
The grep eliminates commented lines and blank lines. sed then strips
away the comment from the remaining lines. You can even sed first and
grep later like:
sed -e 's/;.*$//'|grep -v '^\s*$'
You can even eliminate grep altogether with
sed -e 's/;.*$//;/^\s*$/ d'
--
Raj Kiran Grandhi
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]