From: mxcrew@mx2306.gud.siemens.co.at (The MX-Crew)
Newsgroups: comp.unix.questions
Subject: Re: Aliases in shell K-shell scripts.
Date: 12 Jan 93 16:14:38 GMT
Organization: SIEMENS Austria Corp., A-1100 Wien, Gudrunstr. 11
X-Newsreader: Tin 1.1 PL5

Chaim Manaster (manaster@yu1.yu.edu) wrote:
: 
:  am having a problem trying to get some aliases that I have defined
:  in .kshrc to be recognized by a shell script I use. The script,
:  called menu.sh, invokes the alias names but then gets the
:  response: alias-name not found.
: 
:  Do I need to do something special for a script to recognize the
:  aliases in the K-shell? 
: 
:  I am also trying to pass parameters to the alaises and that isn't
:  working well either. What is the right way to do that. I am trying
:  to use $*, but that isn't working to well. Someone suggested
:  putting the $* reference into a function definition, so I tried
:  that, --same difference, the parameters are ignored. Also the mv
:  commands that follow the rnalias call, report back with usage
:  error for mv. I have no idea why. Originally all the mv's where
:  cp's with a similar usage error report. Can anyone explain why?
: 
:  By the way, the rnyutest alias, doesn't get the usage error report
:  for "mv" and does accept parameters properly as in:
: 	rnyutest comp.unix.questions
: whereas the rnyu and rncol aliases have both problems??
: None of these aliases are recognized froom menu.sh.
: 
:  I am obviously a neophyte at UNIX.
: 
:  Thanks in advance for the help.
: 
:  Henry Manaster
: 
:  ------------------------The .kshrc file follows----------------
: 
: # alias ldir="ls -l $* | more"
: function ldir {
: 	ls -l $* | more
: 	}
: # alias adir="ls -al .[a-zA-Z0-9-]* | more"
: function adir {
: 	ls -al .[a-zA-Z0-9-]* | more
: 	}
: function aadir {
: 	ls -al $* |more
: 	}
: alias elm="elm -z"
: alias postyu="export NNTPSERVER=alsys.edu;post"
: alias postcol="export NNTPSERVER=sol.edu;post"
: function rnalias {
: 	rn $*
: 	}
: alias rnyu='export NNTPSERVER=alsys.edu;cd;mv .newsrc.yu .newsrc;mv .oldnewsrc.yu .oldnewsrc;mv .rnlast.yu .rnlast;mv .rnsoft.yu .rnsoft;rnalias;mv newsrc .newsrc.yu;mv .oldnewsrc .oldnewsrc.yu;mv .rnlast .rnlast.yu;mv .rnsoft .rnsoft.yu'
: alias rncol='export NNTPSERVER=sol.edu;cd;mv .newsrc.col .newsrc;mv .oldnewsrc.col .oldnewsrc;mv .rnlast.col .rnlast;mv .rnsoft.col .rnsoft;rnalias;mv .newsrc .newsrc.col;mv .oldnewsrc .oldnewsrc.col;mv .rnlast .rnlast.col;mv .rnsoft .rnsoft.col'
: alias rnyutest='export NNTPSERVER=alsys.edu;cd;cp .newsrc.yu .newsrc;cp .oldnewsrc.yu .oldnewsrc;cp .rnlast.yu .rnlast;cp .rnsoft.yu .rnsoft;rnalias'
: 
: ----------------------menu.sh follows here ---------------------
: 
: #!//bin/ksh
: # menu.sh - Easy shell for menu to my liking.
: /y/manaster/.kshrc
!!! change this line to . /y/manaster/.kshrc !!!

sorry for my first followup, i saw this line to late

---
 +--------------------------------------------+  /-\o /-()  -- -  --   -
 | PEYERL MICHAEL, SIEMENS AG VIENNA          |  \_/ \\/ )  -- -    --
 | E-MAIL: mxcrew at mx2306.gud.siemens.co.at |       |/_\  -- -  --   -
 +--------------------------------------------+        \_/.  .  . . ........
 Honda NX500 Dominator + 588ccm racepiston