hi scsh fans,
First, thanks to Olin & co for devising a shell based on a nice lang.
It's slowly but surely becoming my fave shell prog lang.
Got a question about the awk macro in version 0.3: Why does
(define (lockd-pid)
(awk (read-line) (line) ()
("lockd" (display (car ((field-splitter ) line))))))
(run (| (ps -ae) ; solaris2 (sysVR4) ps
(begin (lockd-pid))))
(newline)
work fine but
(define proc "lockd")
(define (lockd-pid-bad)
(awk (read-line) (line) ()
(proc (display (car ((field-splitter ) line))))))
(run (| (ps -ae) ; solaris2 (sysVR4) ps
(begin (lockd-pid-bad))))
(newline)
does not. This is on solaris 2.4 and 2.5beta-update.
pg 86-87 of the man says the awk test form can be an integer or string
or expression but does this mean it can't be a var with a string value?
Is this a general "macro thang"? If so, kick me some knowledge...
thx,
glenn
Glenn T Barry
glenn@mathcs.emory.edu
Voice: (404)727-5637 Fax: (404)727-5611
Emory University, Dept of Math and CS, Atlanta, GA 30322-2390
|