Re: Syntax error in Confirm
Ken Irving <[email protected]> Fri, 26 Mar 2010 09:07:30 -0800
| Newsgroups | gmane.mail.smartlist.user |
|---|---|
| Message-ID | <20100326170730.GA2938@localhost> |
On Fri, Mar 26, 2010 at 11:24:39AM -0400, Jo for lists and groups wrote: > Good day all! > We are getting an error in the logs: > > ../.bin/extraddr: subscription request from [email protected] > [email protected] - assigned cookie s03261058491490 > sed: -e expression #1, char 4: Unexpected ',' > > > > Would this refer to the comma in the maxcookies line near the bottom of > confirm_add? How to fix? > > $cat $confirmtxt > $echo "" > > $rm -f _dummy_ `$ls -td cookies/* | $sed -e '1,'$maxcookies' d' ` > > $sed -e 's/^/>/' $tmprequest > ) | $SENDMAIL $sendmailOPT $authaddr > > > I don't know enough about sed (find all shell hard to grasp), but other > programming experience tells me the two sets of ' are ambiguous or > confusing. Is this what was meant - a delet range 1-to-maxcookies - okay to > drop the inner quotes? > > $sed -e '1,$maxcookies d' No, that would leave the literal string '$maxcookies' in the sed command. The original form allows the shell to expand the variable, and at the same time remove the single quotes, so that sed sees a single string, the concatenation of '1,', the value of $maxcookies, and ' d'. If maxcookies is not set then sed would see '1, d', which gives the error you're seeing, e.g.: $ ls | sed '1, d' sed: -e expression #1, char 4: unexpected `,' Ken > > > Many thanks in advance for any assistance. > Jo