* execution in zshrc @ 2018-05-11 10:07 ` Pol (Admin) 2018-05-11 11:31 ` Peter Stephenson 0 siblings, 1 reply; 4+ messages in thread From: Pol (Admin) @ 2018-05-11 10:07 UTC (permalink / raw) To: zsh-users; +Cc: Paolo Pumilia Here enclosed, my script from my zshrc file, to select current running linux udistribtion. At start (e.g. starting a konsole session) it cannot match any linux brand (although 'uname -v' works). therefore exiting with 'unknown distribution'. Yet, sourcing /etc/zshrc at terminal prompt, the correct runnig linux distibution is found. Any hints to fix my script? thank you paolo --- myzsh script --- # System admin aliases depending on the linux distribution # Checking for the running system case `uname -v` in (#i)*ubuntu*) ubuntu_system; echo '**** ubuntu linux ****' # ubuntu linux distribution ;; (#i)*suse*) suse_system; echo 'suse linux distribution' # suse linux distribution ;; *) echo 'unknown linux distribution' # unknown linux distribution ;; --- end ---- ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: execution in zshrc 2018-05-11 10:07 ` execution in zshrc Pol (Admin) @ 2018-05-11 11:31 ` Peter Stephenson 2018-05-11 12:30 ` Pol (Admin) 0 siblings, 1 reply; 4+ messages in thread From: Peter Stephenson @ 2018-05-11 11:31 UTC (permalink / raw) To: zsh-users; +Cc: Paolo Pumilia On Fri, 11 May 2018 12:07:54 +0200 "Pol (Admin)" <xtekhne@gmail.com> wrote: > Here enclosed, my script from my zshrc file, to select current running > linux udistribtion. > At start (e.g. starting a konsole session) it cannot match any linux > brand (although 'uname -v' works). therefore exiting with 'unknown > distribution'. > Yet, sourcing /etc/zshrc at terminal prompt, the correct runnig > linux distibution is found. > > Any hints to fix my script? That means some option is being set in /etc/zshrc that affects the running of the code. It looks like this is probably setopt extendedglob If you put that before the code chunk it should work. pws ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: execution in zshrc 2018-05-11 11:31 ` Peter Stephenson @ 2018-05-11 12:30 ` Pol (Admin) 2018-05-11 14:15 ` Peter Stephenson 0 siblings, 1 reply; 4+ messages in thread From: Pol (Admin) @ 2018-05-11 12:30 UTC (permalink / raw) To: Peter Stephenson; +Cc: zsh-users, Paolo Pumilia That works, thank you, but something is still wrong in my scripts, My ubuntu_system function cannot be found at the start, (yet, noo problem as my zshrc is sourced from terminal) Here enclosed my function thank you paolo -- my zsh function - ubuntu_system () { alias sepg='apt-cache search --names-only ' alias sapg='apt-cache search ' alias saipg='apt-cache search --names-only --installed ' echo "ubuntu system aliases loaded" } --- end On Fri, May 11, 2018 at 1:31 PM, Peter Stephenson <p.stephenson@samsung.com> wrote: > On Fri, 11 May 2018 12:07:54 +0200 > "Pol (Admin)" <xtekhne@gmail.com> wrote: >> Here enclosed, my script from my zshrc file, to select current running >> linux udistribtion. >> At start (e.g. starting a konsole session) it cannot match any linux >> brand (although 'uname -v' works). therefore exiting with 'unknown >> distribution'. >> Yet, sourcing /etc/zshrc at terminal prompt, the correct runnig >> linux distibution is found. >> >> Any hints to fix my script? > > That means some option is being set in /etc/zshrc that affects the > running of the code. > > It looks like this is probably > > setopt extendedglob > > If you put that before the code chunk it should work. > > pws ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: execution in zshrc 2018-05-11 12:30 ` Pol (Admin) @ 2018-05-11 14:15 ` Peter Stephenson 0 siblings, 0 replies; 4+ messages in thread From: Peter Stephenson @ 2018-05-11 14:15 UTC (permalink / raw) To: Pol (Admin), zsh-users; +Cc: Paolo Pumilia On Fri, 11 May 2018 14:30:32 +0200 "Pol (Admin)" <xtekhne@gmail.com> wrote: > That works, thank you, but something is still wrong in my scripts, > My ubuntu_system function cannot be found at the start, (yet, noo > problem as my zshrc is sourced from terminal) > Here enclosed my function This is all standard stuff. You either have your function defined inline in the startup file before it's used --- which is as good as anything if you're always going to need to define it, as you obviously are --- or you use the autoload mechanism: see AUTOLOADING FUNCTIONS in the zshmisc manual. pws ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-05-11 14:15 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <CGME20180511100941epcas3p2a7f5d1bcbf7649f3dd5be354200d3858@epcas3p2.samsung.com> 2018-05-11 10:07 ` execution in zshrc Pol (Admin) 2018-05-11 11:31 ` Peter Stephenson 2018-05-11 12:30 ` Pol (Admin) 2018-05-11 14:15 ` Peter Stephenson
Code repositories for project(s) associated with this public inbox https://git.vuxu.org/mirror/zsh/ This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).