Various scripts use "\ " where the "\" isn't needed.
In an 'awk' pattern, using "\ " is wrong.
In the arg to 'tr', there is no need to '\' a space.
In shell code, <<" foo ">> is easier to read than <<\ foo\ >>.
Also:
In shell code <<name="value">> can be <<name=value>> if <<value>>
doesn't contain unquoted spaces. If value does contain quoted <<">>,
the extra quotes make it hard to read.
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I53d0522071016286b4ef9f576f4a4e46b1ba2d6d
Reviewed-on: https://review.whamcloud.com/39750
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
dd if=$tmpfile of=$testfile bs=$pagesz count=2 oflag=direct ||
error "could not write to file with O_DIRECT (1)"
dd if=$tmpfile of=$testfile bs=$pagesz count=2 oflag=direct ||
error "could not write to file with O_DIRECT (1)"
- respage=$(vmtouch $testfile | awk '/Resident\ Pages:/ {print $3}')
+ respage=$(vmtouch $testfile | awk '/Resident Pages:/ {print $3}')
[ "$respage" == "0/2" ] ||
error "write to enc file fell back to buffered IO"
[ "$respage" == "0/2" ] ||
error "write to enc file fell back to buffered IO"
dd if=$testfile of=$resfile bs=$pagesz count=2 iflag=direct ||
error "could not read from file with O_DIRECT (1)"
dd if=$testfile of=$resfile bs=$pagesz count=2 iflag=direct ||
error "could not read from file with O_DIRECT (1)"
- respage=$(vmtouch $testfile | awk '/Resident\ Pages:/ {print $3}')
+ respage=$(vmtouch $testfile | awk '/Resident Pages:/ {print $3}')
[ "$respage" == "0/2" ] ||
error "read from enc file fell back to buffered IO"
[ "$respage" == "0/2" ] ||
error "read from enc file fell back to buffered IO"
# Strip getstripe output to a space separated list of OSTs
local getstripe_osts=$(echo "$getstripe" | sed -e '1,/obdidx/d' |\
# Strip getstripe output to a space separated list of OSTs
local getstripe_osts=$(echo "$getstripe" | sed -e '1,/obdidx/d' |\
- awk '{print $1}' | tr '\n' '\ ' | sed -e 's/[[:space:]]*$//')
+ awk '{print $1}' | tr '\n' ' ' | sed -e 's/[[:space:]]*$//')
[ "$getstripe_osts" = "${osts//,/ }" ] ||
error "stripes not on specified OSTs"
[ "$getstripe_osts" = "${osts//,/ }" ] ||
error "stripes not on specified OSTs"
# Strip getstripe output to a space separated list of OSTs
local getstripe_osts=$(echo "$getstripe" | sed -e '1,/obdidx/d' |\
# Strip getstripe output to a space separated list of OSTs
local getstripe_osts=$(echo "$getstripe" | sed -e '1,/obdidx/d' |\
- awk '{print $1}' | tr '\n' '\ ' | sed -e 's/[[:space:]]*$//')
+ awk '{print $1}' | tr '\n' ' ' | sed -e 's/[[:space:]]*$//')
[ "$getstripe_osts" = "${osts//,/ }" ] ||
error "stripes not on specified OSTs"
[ "$getstripe_osts" = "${osts//,/ }" ] ||
error "stripes not on specified OSTs"
# Strip getstripe output to a space separated list of OSTs
local getstripe_osts=$(echo "$getstripe" | sed -e '1,/obdidx/d' |\
# Strip getstripe output to a space separated list of OSTs
local getstripe_osts=$(echo "$getstripe" | sed -e '1,/obdidx/d' |\
- awk '{print $1}' | tr '\n' '\ ' | sed -e 's/[[:space:]]*$//')
+ awk '{print $1}' | tr '\n' ' ' | sed -e 's/[[:space:]]*$//')
[ "$getstripe_osts" = "${osts//,/ }" ] ||
error "stripes not on specified OSTs"
[ "$getstripe_osts" = "${osts//,/ }" ] ||
error "stripes not on specified OSTs"
# Strip getstripe output to a space separated list of OSTs
local getstripe_osts=$(echo "$getstripe" | sed -e '1,/obdidx/d' |\
# Strip getstripe output to a space separated list of OSTs
local getstripe_osts=$(echo "$getstripe" | sed -e '1,/obdidx/d' |\
- awk '{print $1}' | tr '\n' '\ ' | sed -e 's/[[:space:]]*$//')
+ awk '{print $1}' | tr '\n' ' ' | sed -e 's/[[:space:]]*$//')
[ "$getstripe_osts" = "${osts//,/ }" ] ||
error "stripes not on specified OSTs"
[ "$getstripe_osts" = "${osts//,/ }" ] ||
error "stripes not on specified OSTs"
if [ $y == "t" ]; then
if [ $x == "b" ]; then
if [ $y == "t" ]; then
if [ $x == "b" ]; then
- ref="\"$(do_facet mds1 date +"%Y-%m-%d\ %H:%M:%S")\""
+ ref=\"$(do_facet mds1 date +"%Y-%m-%d\ %H:%M:%S")\"
- ref="\"$(date +"%Y-%m-%d %H:%M:%S")\""
+ ref=\"$(date +"%Y-%m-%d %H:%M:%S")\"
fi
else
ref=$DIR/$tfile.newer.$x$y
fi
else
ref=$DIR/$tfile.newer.$x$y
sleep 2
if [ $y == "t" ]; then
if [ $x == "b" ]; then
sleep 2
if [ $y == "t" ]; then
if [ $x == "b" ]; then
- negref="\"$(do_facet mds1 date +"%Y-%m-%d\ %H:%M:%S")\""
+ negref=\"$(do_facet mds1 date +"%Y-%m-%d\ %H:%M:%S")\"
- negref="\"$(date +"%Y-%m-%d %H:%M:%S")\""
+ negref=\"$(date +"%Y-%m-%d %H:%M:%S")\"
fi
else
negref=$DIR/$tfile.negnewer.$x$y
fi
else
negref=$DIR/$tfile.negnewer.$x$y
- if [[ " $list " == *\ $name\ * ]]; then
+ if [[ " $list " == *" $name "* ]]; then
# Description:
# Returns list of ip addresses for each interface
local_addr_list() {
# Description:
# Returns list of ip addresses for each interface
local_addr_list() {
- ip addr | awk '/inet\ / {print $2}' | awk -F\/ '{print $1}'
+ ip addr | awk '/inet / {print $2}' | awk -F/ '{print $1}'