~ubuntu-branches/ubuntu/utopic/devscripts/utopic-security

« back to all changes in this revision

Viewing changes to test/bashisms/tilde-expansion.sh

  • Committer: Package Import Robot
  • Author(s): Benjamin Drung
  • Date: 2013-02-18 22:27:33 UTC
  • mfrom: (10.9.22 experimental)
  • Revision ID: package-import@ubuntu.com-20130218222733-7krtkqzko32xte0z
Tags: 2.13.0ubuntu1
* Merge from Debian experimental. Remaining changes:
  - Convert python scripts to python3. (Closes: #680313)
    Debian bug #695259 needs to be fixed to get the change into Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
echo tilde alone: ~/
 
4
echo tilde with name: ~root/
 
5
 
 
6
cd ; cd - >/dev/null
 
7
 
 
8
echo BASHISM: tilde plus: ~+
 
9
echo BASHISM: tilde minus: ~-
 
10
 
 
11
pushd ~ >/dev/null 2>&1     # BASHISM
 
12
for i in $(seq 1 9); do
 
13
    pushd / >/dev/null 2>&1 # BASHISM
 
14
done
 
15
 
 
16
echo BASHISM: tilde plus n: ~+1
 
17
echo BASHISM: tilde implicit plus n: ~1
 
18
echo BASHISM: tilde minus n: ~-1
 
19
 
 
20
echo BASHISM: tilde plus 10: ~+10
 
21
echo BASHISM: tilde implicit plus 10: ~10
 
22
echo BASHISM: tilde minus 10: ~-10
 
23
 
 
24
echo BASHISM=~-/bin
 
25
echo BASHISM=/:~+/bin/
 
26
BASHISM=~-/bin ; echo $BASHISM
 
27
BASHISM=/:~+/bin/ ; echo $BASHISM
 
28
 
 
29
echo nothing wrong here: ~+foo/
 
30
echo nothing wrong here: ~-moo/
 
31
echo nothing wrong here: ~+1foo/
 
32
echo nothing wrong here: ~1foo/
 
33
echo nothing wrong here: ~-1moo/
 
34
 
 
35
# Again, but without the slash
 
36
echo nothing wrong here: ~+foo
 
37
echo nothing wrong here: ~-moo
 
38
echo nothing wrong here: ~+1foo
 
39
echo nothing wrong here: ~1foo
 
40
echo nothing wrong here: ~-1moo
 
41