Want Rehash In A Script

Want Rehash In A Script

Post by Kevin Benk » Fri, 04 Dec 1998 04:00:00



My login shell is tcsh.
My shellscripts are running under "#! /bin/sh"
                             [because Miss Manners said they should]

/bin/sh doesn't recognize the "rehash" command, of course, but I would
like to be able to, within a script, execute the "rehash" command.
How can I do that?

Thank you for your time.

--
      Kevin Benko          / alt.atheism#(1332) /
kevin [at] efn [dot] org  /       --><--       /
Homepage at expected URL /        fnord       /

 
 
 

Want Rehash In A Script

Post by Stephane CHAZEL » Sat, 05 Dec 1998 04:00:00



>My login shell is tcsh.
>My shellscripts are running under "#! /bin/sh"
>                             [because Miss Manners said they should]

>/bin/sh doesn't recognize the "rehash" command, of course, but I would
>like to be able to, within a script, execute the "rehash" command.
>How can I do that?

hash -r

 
 
 

Want Rehash In A Script

Post by Barry Margoli » Sat, 05 Dec 1998 04:00:00




Quote:>My login shell is tcsh.
>My shellscripts are running under "#! /bin/sh"
>                             [because Miss Manners said they should]

>/bin/sh doesn't recognize the "rehash" command, of course, but I would
>like to be able to, within a script, execute the "rehash" command.
>How can I do that?

Rehash only affects the shell in which it's run.  If you do it in a shell
script, it just affects that subshell, not the shell you're typing in.

To make a script be executed by your current C shell, use "source
scriptname".  Naturally, since this script must be executed by csh, it
should be a csh script, not a sh script.  You can also create an alias that
expands to this source command.

--

GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Don't bother cc'ing followups to me.