From e3b16b3856bdd5c1645f4609d61bf5a16c026930 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 May 2024 02:39:23 +0200 Subject: Adding upstream version 2.19.5+deb10u1. Signed-off-by: Daniel Baumann --- test/bashisms/tilde-expansion.sh | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 test/bashisms/tilde-expansion.sh (limited to 'test/bashisms/tilde-expansion.sh') diff --git a/test/bashisms/tilde-expansion.sh b/test/bashisms/tilde-expansion.sh new file mode 100644 index 0000000..e58069a --- /dev/null +++ b/test/bashisms/tilde-expansion.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +echo tilde alone: ~/ +echo tilde with name: ~root/ + +cd ; cd - >/dev/null + +echo BASHISM: tilde plus: ~+ +echo BASHISM: tilde minus: ~- + +pushd ~ >/dev/null 2>&1 # BASHISM +for i in $(seq 1 9); do + pushd / >/dev/null 2>&1 # BASHISM +done + +echo BASHISM: tilde plus n: ~+1 +echo BASHISM: tilde implicit plus n: ~1 +echo BASHISM: tilde minus n: ~-1 + +echo BASHISM: tilde plus 10: ~+10 +echo BASHISM: tilde implicit plus 10: ~10 +echo BASHISM: tilde minus 10: ~-10 + +echo BASHISM=~-/bin +echo BASHISM=/:~+/bin/ +BASHISM=~-/bin ; echo $BASHISM +BASHISM=/:~+/bin/ ; echo $BASHISM + +echo nothing wrong here: ~+foo/ +echo nothing wrong here: ~-moo/ +echo nothing wrong here: ~+1foo/ +echo nothing wrong here: ~1foo/ +echo nothing wrong here: ~-1moo/ + +# Again, but without the slash +echo nothing wrong here: ~+foo +echo nothing wrong here: ~-moo +echo nothing wrong here: ~+1foo +echo nothing wrong here: ~1foo +echo nothing wrong here: ~-1moo + -- cgit v1.2.3