mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 04:13:33 +08:00
make set function work in sh
This commit is contained in:
committed by
Lorenz Meier
parent
4df88122cb
commit
adad22f879
@@ -9,9 +9,11 @@ fi
|
|||||||
|
|
||||||
# Map the NuttX-style variable definition 'set <var> <value>' to something that
|
# Map the NuttX-style variable definition 'set <var> <value>' to something that
|
||||||
# bash and alternatives understand
|
# bash and alternatives understand
|
||||||
set() {
|
# define _set first because sh does not like overwriting set directly
|
||||||
|
_set() {
|
||||||
eval $1=$2
|
eval $1=$2
|
||||||
}
|
}
|
||||||
|
alias set=_set
|
||||||
# alternative method with an alias:
|
# alternative method with an alias:
|
||||||
# alias set='f(){ set -- "$1=$2"; eval "$1"; unset -f f; }; eval f'
|
# alias set='f(){ set -- "$1=$2"; eval "$1"; unset -f f; }; eval f'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user