Skip to contentSkip to conversation

dim: shellcheck v0.4.4 fixes

PATCH In review Jani Nikula 3 participants 18 messages Mar 21, 2017 – Mar 22, 2017 Kbuild

lore
Share & tools
lore
#0 lore raw

cover dim: shellcheck v0.4.4 fixes

Shellcheck version 0.4.4 complains more than the earlier version I was using previously. Shut it up harder.

BR,
Jani.

Jani Nikula (8):
dim: declare and assign separately
dim: use [ p ] || [ q ] instead of test -a/-o
dim: use read -r option
dim: silence shellcheck warning about sourced files
dim: avoid errors with rm $foo/ expanding to /
dim: pipe dim_cite output directly instead of using echo
dim: use grep -c instead of grep|wc
dim: abstract -i interactive pause to a function

 Makefile |  4 ----
 dim      | 46 +++++++++++++++++++++++++++++++---------------
 2 files changed, 31 insertions(+), 19 deletions(-)
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 1/8 dim: declare and assign separately

Fixes shellcheck SC2155: Declare and assign separately to avoid masking return values.

---
 dim | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
dim +2 -2
index 94bdce9dd6cd..c36ebdc7f7d8 100755
@@ -1079,7 +1079,7 @@ function checkpatch_commit
 
 	# FIXME: this relies on local assignment not failing on command
 	# substitution failures
-	local bug_lines=$($cmd | grep -m 1 -B 1 '^\+.*\WBUG' | grep -c '^[+-].*\WBUG')
+	bug_lines=$($cmd | grep -m 1 -B 1 '^\+.*\WBUG' | grep -c '^[+-].*\WBUG')
 	if test "$bug_lines" -eq 1; then
 		warn_or_fail "New BUG macro added"
 	fi
@@ -1087,7 +1087,7 @@ function checkpatch_commit
         if [ "$branch" = "drm-intel-next-queued" ]; then
 		# FIXME: this relies on local assignment not failing on command
 		# substitution failures
-		local non_i915_files=$(git diff-tree --no-commit-id --name-only -r $commit | \
+		non_i915_files=$(git diff-tree --no-commit-id --name-only -r $commit | \
 			grep -v "^\(drivers/gpu/drm/i915/\|include/drm/i915\|include/uapi/drm/i915\)")
 
 		if [ -n "$non_i915_files" ]; then
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH 2/8 dim: use [ p ] || [ q ] instead of test -a/-o

In reply to Jani Nikula

Fix shellcheck SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.

---
 dim | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
dim +2 -2
index c36ebdc7f7d8..eb0f0df85338 100755
@@ -160,7 +160,7 @@ done
 shift $((OPTIND - 1))
 
 # first positional argument is the subcommand
-if [ -n "$HELP" -o "$#" = "0" ]; then
+if [ -n "$HELP" ] || [ "$#" = "0" ]; then
     subcommand="usage"
 else
     subcommand="$1"
@@ -178,7 +178,7 @@ if [[ -n "$__dim_running" ]]; then
 fi
 export __dim_running=1
 
-if [ "$subcommand" != "setup" -a "$subcommand" != "help" -a "$subcommand" != "usage" ]; then
+if [ "$subcommand" != "setup" ] && [ "$subcommand" != "help" ] && [ "$subcommand" != "usage" ]; then
 	for d in $DIM_PREFIX $DIM_PREFIX/$DIM_DRM_INTEL $DIM_PREFIX/drm-rerere $DIM_PREFIX/drm-tip; do
 		if [ ! -d $d ]; then
 			echo "$d is missing, please check your configuration and/or run dim setup"
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

PATCH 3/8 dim: use read -r option

In reply to Jani Nikula

Fix shellcheck SC2162: read without -r will mangle backslashes.

---
 dim | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
dim +3 -3
index eb0f0df85338..048b5f0f8345 100755
@@ -104,7 +104,7 @@ function read_integration_config
 	dim_branches=
 	for conf in "${drm_tip_config[@]}"; do
 		local repo branch override
-		read repo branch override <<< $conf
+		read -r repo branch override <<< $conf
 		if [[ "$repo" = "drm-intel" || "$repo" = "drm-misc" ]]; then
 			dim_branches="$dim_branches $branch"
 		fi
@@ -255,7 +255,7 @@ function branch_to_repo # branch
 {
 	for conf in "${drm_tip_config[@]}"; do
 		local repo branch override
-		read repo branch override <<< $conf
+		read -r repo branch override <<< $conf
 
 		if [[ "$branch" == "$1" ]] ; then
 			echo $repo
@@ -521,7 +521,7 @@ function dim_rebuild_tip
 	for conf in "${drm_tip_config[@]}"; do
 		local branch override sha1 fixup_file
 
-		read repo branch override <<< $conf
+		read -r repo branch override <<< $conf
 		url=${drm_tip_repos[$repo]}
 		remote=$(url_to_remote $url)
 		sha1=$remote/$branch
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

PATCH 4/8 dim: silence shellcheck warning about sourced files

In reply to Jani Nikula

Silence shellcheck SC1090: Can't follow non-constant source. Use a directive to specify location.

Shellcheck is capable of checking the sourced files too, but only if the source is at a constant location.

---
 dim | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
dim +3 -1
index 048b5f0f8345..0fe125335a67 100755
@@ -38,7 +38,8 @@ set -e
 # dim configuration file
 DIM_CONFIG=${DIM_CONFIG:-$HOME/.dimrc}
 if [ -r $DIM_CONFIG ]; then
-    . $DIM_CONFIG
+	# shellcheck source=/dev/null
+	. $DIM_CONFIG
 fi
 
 # prefix for repo directories
@@ -98,6 +99,7 @@ function read_integration_config
 	declare -g -a drm_tip_config
 
 	if [ -r $DIM_PREFIX/drm-rerere/$integration_config ]; then
+		# shellcheck source=/dev/null
 		source $DIM_PREFIX/drm-rerere/$integration_config
 	fi
 
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

PATCH 5/8 dim: avoid errors with rm $foo/ expanding to /

In reply to Jani Nikula

Fix shellcheck SC2115: Use "${var:?}" to ensure this never expands to /.

---
 dim | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
dim +12 -4
index 0fe125335a67..8bbff67b3f80 100755
@@ -461,18 +461,26 @@ function rr_cache_dir
 
 function update_rerere_cache
 {
+	local rerere
+
+	rerere=$(rr_cache_dir)
+
 	cd $DIM_PREFIX/drm-rerere/
 	git pull
-	mkdir $(rr_cache_dir) &> /dev/null || true
-	cp rr-cache/* $(rr_cache_dir) -r
+	mkdir ${rerere:?} &> /dev/null || true
+	cp rr-cache/* ${rerere:?} -r
 	cd - > /dev/null
 }
 
 function dim_revert_rerere
 {
+	local rerere
+
+	rerere=$(rr_cache_dir)
+
 	cd $DIM_PREFIX/drm-rerere/
 	git revert $1
-	rm $(rr_cache_dir)/* -Rf
+	rm -Rf ${rerere:?}/*
 }
 
 dim_alias_rebuild_nightly=rebuild-tip
@@ -974,7 +982,7 @@ function dim_remove_branch
 	cd $DIM_PREFIX/$DIM_DRM_INTEL
 
 	if [[ -d $DIM_PREFIX/$branch ]] ; then
-		rm -R $DIM_PREFIX/$branch
+		rm -R ${DIM_PREFIX:?}/$branch
 		git worktree prune &> /dev/null || true
 	fi
 
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#13 lore raw

PATCH 6/8 dim: pipe dim_cite output directly instead of using echo

In reply to Jani Nikula

Fix shellcheck SC2005: Useless echo? Instead of 'echo $(cmd)', just use 'cmd'.

---
 Makefile | 1 -
 dim      | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
Makefile +0 -1
index 89b381c1e0aa..fe7e44ad69d9 100644
@@ -21,7 +21,6 @@ dim.html: dim.rst
 
 SC_EXCLUDE := \
 	-e SC2001 \
-	-e SC2005 \
 	-e SC2034 \
 	-e SC2046 \
 	-e SC2086 \
dim +1 -1
index 8bbff67b3f80..16e489c0b508 100755
@@ -858,7 +858,7 @@ function dim_cherry_pick_branch
 		commit_list_references $commit
 		if ! git cherry-pick -x -s $commit; then
 			echo "FAILED: $(dim_cite $commit)"
-			echo "$(dim_cite $commit)" >> $fail_log
+			dim_cite $commit >> $fail_log
 			git cherry-pick --abort
 		fi
 	done
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#14 lore raw

PATCH 7/8 dim: use grep -c instead of grep|wc

In reply to Jani Nikula

Fix shellcheck SC2126: Consider using grep -c instead of grep|wc.

---
 Makefile | 1 -
 dim      | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
Makefile +0 -1
index fe7e44ad69d9..78087f669221 100644
@@ -28,7 +28,6 @@ SC_EXCLUDE := \
 	-e SC2090 \
 	-e SC2119 \
 	-e SC2120 \
-	-e SC2126 \
 	-e SC2143
 
 shellcheck:
dim +1 -1
index 16e489c0b508..53221de9171c 100755
@@ -496,7 +496,7 @@ function dim_rebuild_tip
 	rerere=$DIM_PREFIX/drm-rerere
 
 	cd $rerere
-	if [[ $(git status --porcelain | grep -v "^[ ?][ ?]" | wc -l) -gt 0 ]]; then
+	if [[ $(git status --porcelain | grep -c -v "^[ ?][ ?]") -gt 0 ]]; then
 		warn_or_fail "integration configuration file $integration_config not commited"
 	fi
 
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#17 lore raw

PATCH 8/8 dim: abstract -i interactive pause to a function

In reply to Jani Nikula

Fixes shellcheck SC2089: Quotes/backslashes will be treated literally. Use an array.

Fixes shellcheck SC2090: Quotes/backslashes in this variable will not be respected.

---
 Makefile | 2 --
 dim      | 8 +++++++-
 2 files changed, 7 insertions(+), 3 deletions(-)
Makefile +0 -2
index 78087f669221..1f628e9489f9 100644
@@ -24,8 +24,6 @@ SC_EXCLUDE := \
 	-e SC2034 \
 	-e SC2046 \
 	-e SC2086 \
-	-e SC2089 \
-	-e SC2090 \
 	-e SC2119 \
 	-e SC2120 \
 	-e SC2143
dim +7 -1
index 53221de9171c..702df1d69988 100755
@@ -139,6 +139,12 @@ function warn_or_fail
 	fi
 }
 
+function pause
+{
+	read -rsp "Press any key to continue..." -n1 key2
+	echo
+}
+
 while getopts hdfi opt; do
 	case "$opt" in
 		d)
@@ -149,7 +155,7 @@ while getopts hdfi opt; do
 			FORCE=1
 			;;
 		i)
-			INTERACTIVE='eval read -rsp "Press any key to continue..." -n1 key2; echo'
+			INTERACTIVE=pause
 			;;
 		h)
 			HELP=1
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw

Re: [PATCH 5/8] dim: avoid errors with rm $foo/ expanding to /

In reply to Jani Nikula
Quoted 3 lines · Jani Nikula

Fix shellcheck SC2115: Use "${var:?}" to ensure this never expands to /.

I'm not sold on these because if those are ever unset, dim will fail all over the place.

I'm leaning towards shutting this one up.
-Daniel

Quoted 54 lines
---
 dim | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
dim +12 -4
index 0fe125335a67..8bbff67b3f80 100755
@@ -461,18 +461,26 @@ function rr_cache_dir
 
 function update_rerere_cache
 {
+	local rerere
+
+	rerere=$(rr_cache_dir)
+
 	cd $DIM_PREFIX/drm-rerere/
 	git pull
-	mkdir $(rr_cache_dir) &> /dev/null || true
-	cp rr-cache/* $(rr_cache_dir) -r
+	mkdir ${rerere:?} &> /dev/null || true
+	cp rr-cache/* ${rerere:?} -r
 	cd - > /dev/null
 }
 
 function dim_revert_rerere
 {
+	local rerere
+
+	rerere=$(rr_cache_dir)
+
 	cd $DIM_PREFIX/drm-rerere/
 	git revert $1
-	rm $(rr_cache_dir)/* -Rf
+	rm -Rf ${rerere:?}/*
 }
 
 dim_alias_rebuild_nightly=rebuild-tip
@@ -974,7 +982,7 @@ function dim_remove_branch
 	cd $DIM_PREFIX/$DIM_DRM_INTEL
 
 	if [[ -d $DIM_PREFIX/$branch ]] ; then
-		rm -R $DIM_PREFIX/$branch
+		rm -R ${DIM_PREFIX:?}/$branch
 		git worktree prune &> /dev/null || true
 	fi
 
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#15 lore raw

Re: [PATCH 7/8] dim: use grep -c instead of grep|wc

In reply to Jani Nikula
Quoted 25 lines · Jani Nikula

Fix shellcheck SC2126: Consider using grep -c instead of grep|wc.

---
 Makefile | 1 -
 dim      | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
Makefile +0 -1
index fe7e44ad69d9..78087f669221 100644
@@ -28,7 +28,6 @@ SC_EXCLUDE := \
 	-e SC2090 \
 	-e SC2119 \
 	-e SC2120 \
-	-e SC2126 \
 	-e SC2143
 
 shellcheck:
dim +0 -0
index 16e489c0b508..53221de9171c 100755

dim function dim_rebuild_tip · line 499

Quoted 5 lines
dim +1 -1
@@ -496,7 +496,7 @@ function dim_rebuild_tip
 	rerere=$DIM_PREFIX/drm-rerere
 
 	cd $rerere
-	if [[ $(git status --porcelain | grep -v "^[ ?][ ?]" | wc -l) -gt 0 ]]; then
+	if [[ $(git status --porcelain | grep -c -v "^[ ?][ ?]") -gt 0 ]]; then

grep -q and drop the -gt 0?

Quoted 10 lines
dim +0 -0
 		warn_or_fail "integration configuration file $integration_config not commited"
 	fi
 
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#16 lore raw

PATCH v2 1/1 dim: use grep -q instead of grep|wc

Fix shellcheck SC2126: Consider using grep -c instead of grep|wc.

We can use -q as suggested by Daniel because we don't care about the exact count.

---
 Makefile | 1 -
 dim      | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
Makefile +0 -1
index 139fd82ba441..1f628e9489f9 100644
@@ -26,7 +26,6 @@ SC_EXCLUDE := \
 	-e SC2086 \
 	-e SC2119 \
 	-e SC2120 \
-	-e SC2126 \
 	-e SC2143
 
 shellcheck:
dim +1 -1
index d961bb493616..33b393d3f27a 100755
@@ -502,7 +502,7 @@ function dim_rebuild_tip
 	rerere=$DIM_PREFIX/drm-rerere
 
 	cd $rerere
-	if [[ $(git status --porcelain | grep -v "^[ ?][ ?]" | wc -l) -gt 0 ]]; then
+	if git status --porcelain | grep -q -v "^[ ?][ ?]"; then
 		warn_or_fail "integration configuration file $integration_config not commited"
 	fi
 
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

Re: [PATCH 5/8] dim: avoid errors with rm $foo/ expanding to /

In reply to Daniel Vetter
Quoted 7 lines · Daniel Vetter
Quoted 3 lines · Jani Nikula

Fix shellcheck SC2115: Use "${var:?}" to ensure this never expands to /.

I'm not sold on these because if those are ever unset, dim will fail all over the place.

Yup, like at the top where we specifically ensure $DIM_PREFIX is not empty!

Quoted 1 line

I'm leaning towards shutting this one up.

I know, I was divided about this one as well, but erred on the safe side because 'rm -Rf /*' is such a huge failure mode.

I could lean either way.

BR,
Jani.

Quoted 56 lines

-Daniel

Quoted 54 lines
---
 dim | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
dim +12 -4
index 0fe125335a67..8bbff67b3f80 100755
@@ -461,18 +461,26 @@ function rr_cache_dir
 
 function update_rerere_cache
 {
+	local rerere
+
+	rerere=$(rr_cache_dir)
+
 	cd $DIM_PREFIX/drm-rerere/
 	git pull
-	mkdir $(rr_cache_dir) &> /dev/null || true
-	cp rr-cache/* $(rr_cache_dir) -r
+	mkdir ${rerere:?} &> /dev/null || true
+	cp rr-cache/* ${rerere:?} -r
 	cd - > /dev/null
 }
 
 function dim_revert_rerere
 {
+	local rerere
+
+	rerere=$(rr_cache_dir)
+
 	cd $DIM_PREFIX/drm-rerere/
 	git revert $1
-	rm $(rr_cache_dir)/* -Rf
+	rm -Rf ${rerere:?}/*
 }
 
 dim_alias_rebuild_nightly=rebuild-tip
@@ -974,7 +982,7 @@ function dim_remove_branch
 	cd $DIM_PREFIX/$DIM_DRM_INTEL
 
 	if [[ -d $DIM_PREFIX/$branch ]] ; then
-		rm -R $DIM_PREFIX/$branch
+		rm -R ${DIM_PREFIX:?}/$branch
 		git worktree prune &> /dev/null || true
 	fi
 
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw

Re: [PATCH 5/8] dim: avoid errors with rm $foo/ expanding to /

Quoted 12 lines · Jani Nikula
Quoted 7 lines · Daniel Vetter
Quoted 3 lines · Jani Nikula

Fix shellcheck SC2115: Use "${var:?}" to ensure this never expands to /.

I'm not sold on these because if those are ever unset, dim will fail all over the place.

Yup, like at the top where we specifically ensure $DIM_PREFIX is not empty!

Quoted 6 lines
Quoted 1 line

I'm leaning towards shutting this one up.

I know, I was divided about this one as well, but erred on the safe side because 'rm -Rf /*' is such a huge failure mode.

I could lean either way.

Even for this failure mode it feels like noise ... I guess bash scripting just is noise, and we'll live with it?

Saying, Ḯ'm also ok with you pushing this. We might eventually have a command where the input is user-supplied and if absent could result in tears. I just fixed that broken default handling for dim retip :-) -Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw

Re: [PATCH 5/8] dim: avoid errors with rm $foo/ expanding to /

Quoted 18 lines · Daniel Vetter
Quoted 17 lines · Jani Nikula
Quoted 7 lines · Daniel Vetter
Quoted 3 lines · Jani Nikula

Fix shellcheck SC2115: Use "${var:?}" to ensure this never expands to /.

I'm not sold on these because if those are ever unset, dim will fail all over the place.

Yup, like at the top where we specifically ensure $DIM_PREFIX is not empty!

Quoted 1 line

I'm leaning towards shutting this one up.

I know, I was divided about this one as well, but erred on the safe side because 'rm -Rf /*' is such a huge failure mode.

Quoted 8 lines
Quoted 1 line

I could lean either way.

Even for this failure mode it feels like noise ... I guess bash scripting just is noise, and we'll live with it?

Saying, Ḯ'm also ok with you pushing this. We might eventually have a command where the input is user-supplied and if absent could result in tears. I just fixed that broken default handling for dim retip :-)

rm -rf / woes can be remedied by always passing "--preserve-root" to rm (I believe that this is the default already though).

Kind regards, David
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#10 lore raw

Re: [PATCH 5/8] dim: avoid errors with rm $foo/ expanding to /

Quoted 2 lines · David Weinehall

rm -rf / woes can be remedied by always passing "--preserve-root" to rm (I believe that this is the default already though).

That doesn't help with 'rm -rf /*' though.

BR,
Jani.

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#11 lore raw

Re: [PATCH 5/8] dim: avoid errors with rm $foo/ expanding to /

Quoted 5 lines · Jani Nikula
Quoted 2 lines · David Weinehall

rm -rf / woes can be remedied by always passing "--preserve-root" to rm (I believe that this is the default already though).

That doesn't help with 'rm -rf /*' though.

Hmmm, but how would you end up with that if it does /$foo and $foo="" or unset?

Kind regards, David
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#12 lore raw

Re: [PATCH 5/8] dim: avoid errors with rm $foo/ expanding to /

Quoted 9 lines · David Weinehall
Quoted 5 lines · Jani Nikula
Quoted 2 lines · David Weinehall

rm -rf / woes can be remedied by always passing "--preserve-root" to rm (I believe that this is the default already though).

That doesn't help with 'rm -rf /*' though.

Hmmm, but how would you end up with that if it does /$foo and $foo="" or unset?

There's a 'rm -rf $foo/*'

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx