- Subject: dracut [PATCH] Parameter expansion occurs before command evaluation.
- From: John Reiser <jreiser@xxxxxxxxxxxx>
- Date: Fri, 23 Sep 2011 08:02:23 -0700
- Cc: initramfs@xxxxxxxxxxxxxxx
- Organization: -
- User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.22) Gecko/20110906 Fedora/3.1.14-1.fc14 Thunderbird/3.1.14
Bash shell expands all ${parameter} before evaluating a command.
For multiple declarations and assignments within the same 'local' command,
then new variables or new values that appear towards the left
do not affect parameter expansion towards the right.
--
John Reiser, jreiser@xxxxxxxxxxxx
>From 507ad6f66fc66f868a9e5fdd3806e012c4022baa Mon Sep 17 00:00:00 2001
From: John Reiser <jreiser@xxxxxxxxxxxx>
Date: Fri, 23 Sep 2011 07:37:43 -0700
Subject: [PATCH] Parameter expansion occurs before command evaluation.
${parameter} on the right is expanded before evaluating "local var=value"
on the left.
---
dracut-functions | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dracut-functions b/dracut-functions
index 5508809..c4f7f61 100755
--- a/dracut-functions
+++ b/dracut-functions
@@ -272,7 +272,7 @@ check_vol_slaves() {
inst_dir() {
[[ -e ${initdir}"$1" ]] && return 0 # already there
- local _dir="$1" _part=${_dir%/*} _file
+ local _dir="$1" _part="${1%/*}" _file
while [[ "$_part" != "${_part%/*}" ]] && ! [[ -e "${initdir}${_part}" ]]; do
_dir="$_part $_dir"
_part=${_part%/*}
--
1.7.6
[Home]
[Linux USB Devel]
[Video for Linux]
[Linux Audio Users]
[Photo]
[Yosemite News]
[Yosemite Photos]
[Free Online Dating]
[Linux Kernel]
[Linux SCSI]
[XFree86]