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

Re: more ?s WHOOPS!!!!!



Peter Paluch writes:
> I tried the chat on the command line and it works just fine. However, if
> someone tries to run chat within pppd (parameter "connect") without '\',
> it goes awry. Here, have a look at this:
 
> I type this command:
 
> knm:~# pppd /dev/ttyS0 connect "chat -v '' 'at$n=1' OK"
 
> And this is what I found in /var/log/ppp.log:
 
> Feb 15 19:12:07 knm pppd[494]: pppd 2.2.0 started by root, uid 0
> Feb 15 19:12:08 knm chat[495]: send (at=1^M) 
> Feb 15 19:12:08 knm chat[495]: expect (OK) 
> Feb 15 19:12:08 knm chat[495]: at=1^M^M      ##### <--- see that ?!
> Feb 15 19:12:08 knm chat[495]: OK -- got it

Yes, you are right.  When you type

	pppd /dev/ttyS0 connect "chat -v '' 'at$n=1' OK"

and hit return, your shell eats the single quotes.  Then, when pppd
receives the 'connect' option, it passes the arguments to 'connect' to the
shell.  That shell then eats the '$'.  I was assuming that the chat strings
were in an option file. If you put

	connect chat -v '' 'at$n=1' OK

in one of pppd's option files, the strings are handled by only one shell.
It eats the single quote, and everything is ok.

The best way to go is to use 'chat -f <chatfile>'.  Then the chat strings
are never touched by any shell, and you don't need to deal with shell
quoting and escapes.
-- 
John Hasler
john@dhh.gt.org (John Hasler)
Dancing Horse Hill
Elmwood, WI


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: