Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: retrieving invocation arguments



Bart Schaefer (schaefer@xxxxxxxxxxxxxxxx) wrote:
> On Sep 14,  9:42pm, Adam Spiers wrote:
> } What's the best way of retrieving the arguments with which zsh was
> } invoked?

[lots of remarkably helpful info snipped]

It continually staggers me how helpful the zsh-users are.  So many
times I've seen a simple question asked, and answers come back in
glorious detail.  Thanks Bart and everyone else for this; I think it's
a huge asset to zsh.

> } It doesn't appear to be stored in any parameter set by the shell.
> } Worth doing?
> 
> It wouldn't be particularly difficult, but what's the application you
> have in mind?

Nothing more complex than being able type `restart' to restart the
shell exactly how it was invoked.  Currently I have

  restart () {
      exec $SHELL "$SHELL_ARGS" "$@"
  }

and I do

  export SHELL_ARGS="$@"

in my ~/.switch_shell (run from bash).



Messages sorted by: Reverse Date, Date, Thread, Author