From: René Scharfe Date: Fri, 03 Aug 2007 23:40:23 GMT Subject: Re: Help a sed noob Message-ID: <46B3BCE7.3090509@lsrfire.ath.cx> In-Reply-To: Nguyen Thai Ngoc Duy schrieb: > Hi, > > There is a construct like this in git-parse-remote.sh which makes > busybox ash unhappy: > > sed -ne '/^URL: */{ > s///p > q > }' "$GIT_DIR/remotes/$1" > > It complains about "no previous regexp" while gnu sed is ok. Can > anyone explain to me what does "s///p" do? GNU Sed info page says > nothing about empty regexp. If I replace it with "s/\(.*\)/\1/p" then > I get "URL: " along with the remote path. > > By the way, can we use another construct instead? It would be less > work for me ;-) You could manually add the previous regular expression, like this: sed -ne '/^URL: */{ s/^URL: *//p q }' "$GIT_DIR/remotes/$1" René