auto removing aliases in csh?

auto removing aliases in csh?

Post by Vincent Tag » Tue, 08 Nov 1994 08:30:04



I'm trying to write a shell script that will automatically unalias all of my
aliases in csh. this is what I have so far:

#!/bin/csh -f

# rm-aliases
set done=0
while ($done == 0)
  set alias=(`line`)
  if ($status) then
    set done=1
  endif
  if ($#alias > 0) then
    echo $alias[1]
  endif
end

and then at the prompt:
alias | rm-aliases | xargs -n1 -t unalias

the -t option echos whatever commands xargs executes and as such, echoes
unalias <alias> but my aliases are still there. I also tried (alias|rm-aliases)
but that didn't work either. can someone help me out here?

--

Computer Science major at UC Irvine and a kender trapped in a human body
"It's all fun and games till someone loses an eye; then it becomes a scavenger
hunt."

 
 
 

1. csh: if-then-else-endif in csh alias?


: I am converting some Korn Shell scripts to Csh.

Leave them in ksh.  Especially if they work.

: The Korn Shell scripts have some simple shell functions that use
: if-then-else-fi control structures in them. Is there no way to do
: this with a Csh alias? I know that you can do plain one-line if
: constructs in a Csh alias, but the bug in the pudding comes when
: I try to do the then-else-endif.

That's because you can't do one-line if-then-else-endif constructs in
csh.  You just can't.  It's impossible.  Same goes for foreaches.

Don't write shell scripts in csh.  It's broken.  Really.  It should've
never gotten out in the first place.  There's a detailed FAQ.

--Dave

2. 3-button ADB mice

3. server redirects by client domain

4. nis, nfs, autofs: auto.master, auto.misc, auto.home help please

5. How can you get Linux to log into NT Server 4.0

6. How can I auto-reboot a SUN, then auto-login, then auto-start a program?

7. Question about DNS

8. How to auto-reboot a SUN, then auto-login, then auto-start a program?

9. aliases, aliases, aliases...

10. script alias problem - Re: apache alias and script alias problem

11. csh: Autologout not set but still auto-logs me out

12. Jason Neumann: ppp -auto -alias demand (problems)