Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sed and xentools413



rvp%SDF.ORG@localhost (RVP) writes:

>The NetBSD sed doesn't understand '\t' as signifying a tab:

>You'll have to rewrite that regex like this:
>$ nl /etc/motd | sed 's/^ *\([0-9]*\)'$'\t''.*$/\1/'


The $'\t' syntax is also new. For old shells (e.g. NetBSD-8) you need to use
a literal TAB. Usually like:

TAB='	' # <--- literal TAB

sed "s/^ *\([0-9]*\)${TAB}.*$/\1/"

-- 
-- 
                                Michael van Elst
Internet: mlelstv%serpens.de@localhost
                                "A potential Snark may lurk in every tree."


Home | Main Index | Thread Index | Old Index