Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!ux1.cso.uiuc.edu!uiucdcs!carroll From: carroll@cs.uiuc.edu (Alan M. Carroll) Newsgroups: comp.unix.shell Subject: Re: Passing parameters to an alias in ksh ...under AIX Message-ID: <1990Dec6.235416.4057@ux1.cso.uiuc.edu> Date: 6 Dec 90 23:54:16 GMT References: <1235@lafayet.UUCP> Sender: news@ux1.cso.uiuc.edu (News) Reply-To: carroll@cs.uiuc.edu (Alan M. Carroll) Distribution: na Organization: Technophiles Inc. - Engineers with Attitude Lines: 39 In article <1235@lafayet.UUCP>, rob@lafayet.UUCP (Rob Freyder) writes: > I am trying to pass a parameter to an alias under AIX on the RS6000. You cannot access parameters in ksh alias's as you can in csh. What you want is a function, instead. Here is my code to set my xterm title: # ] 0 ; string and string will become the title and icon name # ] 1 ; string for icon name only # ] 2 ; string for title name only # control codes removed - you'll have to fix them on your end. XTITLEPRE="^[]2;" XICONPRE="^[]1;" XPOST="^G" unalias cd function CD { \cd $@ PRWD=${PWD##${HOME}} if [ ! "${PRWD}" = "${PWD}" ] ; then PRWD="~$PRWD" fi if [[ "$TERM" = "xterm" && "$NOXTITLE" = "" ]] ; then print -n -r "${XTITLEPRE}${XTITLE}${PRWD}@${HOST}${XPOST}" fi } alias cd=CD # Fix up the icon title just once, with the host. if [ "$TERM" = "xterm" ] ; then print -n -r "${XICONPRE}${HOST}${XPOST}" fi -- Alan M. Carroll "It's psychosomatic. You need a lobotomy. Epoch Development Team I'll get a saw." CS Grad / U of Ill @ Urbana ...{ucbvax,pur-ee,convex}!cs.uiuc.edu!carroll