Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: sourcing a sh file in zsh
- X-seq: zsh-workers 26323
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: sourcing a sh file in zsh
- Date: Fri, 16 Jan 2009 10:29:34 -0800
- In-reply-to: <200901161939.54651.arvidjaar@xxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <BD9D2405-AD6A-4336-9C8A-85149165B6B8@xxxxxxxxx> <090116075615.ZM21871@xxxxxxxxxxxxxxxxxxxxxx> <200901161939.54651.arvidjaar@xxxxxxxxxx>
[Moved to -workers]
On Jan 16, 7:39pm, Andrey Borzenkov wrote:
}
} > You'll probably need to do something like
} >
} > emulate sh
} > source bla.sh
}
} Given that most distributions have equivalence of /etc/profile.d, having
} simple zsh way to do it (without scoping issues) would be nice.
I'm reluctant to suggest adding options to "source", but introducing an
alternate name ("zsource"?) might allow something like
zsource -e sh file.sh
with the obvious meaning of "turn on sh emulation while sourcing" and
would otherwise behave like "source". Might need a variant that has
the path-searching semantics of "." as well.
Another possibility would be to extend the "emulate" command into a
precommand modifier sort of thing, where arguments following the name
of the emulation are treated as a command to execute. Perhaps require
another option to make this active, to avoid any compatibily issue.
emulate -LRE sh source file.sh
(I can't decide whether the new option should be S(ource), X(ecute),
or E(val), nor whether it should be upper case.)
In this case the -c and -a options of "exec" might be included as well.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author