Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!ncar!gatech!rutgers!bpa!cbmvax!vu-vlsi!mpx1!mpx2!erik From: erik@mpx2.UUCP (Erik Murrey) Newsgroups: comp.unix.wizards Subject: Re: Echo Message-ID: <310@mpx2.UUCP> Date: 11 Dec 88 22:33:17 GMT References: <6557@june.cs.washington.edu> <960@etnibsd.UUCP> <2258@xyzzy.UUCP> Reply-To: erik@mpx2.UUCP (Erik Murrey) Organization: MPX Data Systems, Inc. , Wayne, PA Lines: 30 In article <2258@xyzzy.UUCP> meissner@xyzzy.UUCP (Michael Meissner) writes: > [ ... ] >like I do (in /bin/sh notation): > > if [ -x /bin/sun3 ] && /bin/sun3; then > SYSVECHO=/usr/5bin/echo > else > SYSVECHO=echo > fi > > # ... > > ${SYSVECHO} ... While this does work, it is *very* ugly. Try plowing through big shell scripts that use ${NAME-OF-PROGRAM-TO-RUN}'s all over the place. They may be more secure, but at the cost of maintainability. Setting the PATH & IFS at the top of each shell script fixes most security holes. Personally, I like the echo that I have here (and a similar one was posted to comp.sources.misc) that can understand both the BSD flags, and the Sys-V escapes. Maybe SysV.4 should have a "raw" echo for those times when you just want the actual arguments, un-retouched, sent to stdout. -- Erik Murrey /| // /~~~~/ | / MPX Data Systems, Inc. / | / / /____/ |/ erik@mpx2.UUCP / / / / /| Data Systems, Inc. {spl1,vu-vlsi,bpa}!mpx1!erik / / / / |====================