Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!rutgers!mcdchg!heiby From: heiby@mcdchg.chg.mcd.mot.com (Ron Heiby) Newsgroups: comp.unix.shell Subject: Re: ksh prompt Message-ID: <57993@mcdchg.chg.mcd.mot.com> Date: 6 Mar 91 00:33:16 GMT References: <1772@brchh104.bnr.ca> <1991Feb28.173758.21195@en.ecn.purdue.edu> <57517@mcdchg.chg.mcd.mot.com> <1991Mar4.133215.12269@cbnews.att.com> Organization: Motorola Computer Group, Schaumburg, IL Lines: 27 lvc@cbnews.att.com (lawrence.v.cipriani) writes: >I suggest the cd in function ch be quoted: > function ch { > if "cd" ${*:-''} ... >so that a second ". $ENV" will not see 'ch' inside of function ch. Yes, that seems to be a good idea. I never ran into that, because I never do a second ". $ENV". Actually, I almost never do one, allowing ksh to do it for me as it starts up. With the prompt string all this gives you, it's pretty obvious that it has already been done! >Why not use "${@:-''}" instead of ${*:-''} ? Using the at-sign version ensures that if you pass multiple parameters to cd, that the parameters will be seperated by space characters. The asterisk version uses the first character of $IFS as the seperator. I don't see that it really matters all that much. Of course, if you don't have a space in your IFS string for some wierd reason, then using the at-sign here will leave you with your parameters lumped together with space seperators that will not be interpreted to be seperators (since space isn't in $IFS)! I guess that's a pretty good reason to leave this one as is! -- Ron Heiby, heiby@chg.mcd.mot.com Moderator: comp.newprod "Wrong is wrong, even when it helps you." Popeye