mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-24 17:00:32 +02:00
Kris Shannon: 20801: fix missing $ in expression to parse script
This commit is contained in:
parent
aaec0ef0ad
commit
8acdfd2981
2 changed files with 6 additions and 1 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2005-02-09 Bart Schaefer <schaefer@zsh.org>
|
||||
|
||||
* Kris Shannon: 20801: Completion/Unix/Command/_init_d: fix
|
||||
missing $ in the param expansion that parses the init script.
|
||||
|
||||
2005-02-07 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 20798: Src/init.c: need to propagate some #ifdef's to get
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ script=$words[1]
|
|||
what='(st(art|op|atus)|(force-|)re(start|load)|debug_(up|down)|dump(|_stats)|add|delete|clean|list)'
|
||||
|
||||
read -u0 -k2 magic < $script && [[ $magic = '#!' ]] &&
|
||||
cmds=( ${${(j:|:s:|:)${(M)${(f)"$(< $script)"}:#[[:blank:]]#(\'|)${~what}(\|{~what})#(\'|)\)}}//[^a-z_]} )
|
||||
cmds=( ${${(j:|:s:|:)${(M)${(f)"$(< $script)"}:#[[:blank:]]#(\'|)${~what}(\|${~what})#(\'|)\)}}//[^a-z_]} )
|
||||
|
||||
# This would be the pattern to use every line of the form <space>foo).
|
||||
# Some people say this might match too many lines...
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue