Bash -a option

GET THE HANG [ -a option ]

$ 4.1.5 1 387---> vim cond-a.sh
$ 4.1.5 2 388---> sh cond-a.sh
cond-a.sh: 3: Syntax error: end of file unexpected (expecting "then")
$ 4.1.5 3 389---> vim cond-a.sh
$ 4.1.5 4 390---> sh cond-a.sh
cond-a.sh: 4: Syntax error: end of file unexpected (expecting "fi")
$ 4.1.5 5 391---> vim cond-a.sh
$ 4.1.5 6 392---> sh cond-a.sh
[: 4: -a: unexpected operator
$ 4.1.5 7 393---> vim cond-a.sh
$ 4.1.5 8 394---> sh cond-a.sh
yes
$ 4.1.5 9 395---> ls a.out
ls: cannot access a.out: No such file or directory
$ 4.1.5 10 396---> pwd
/home/jeffrin
$ 4.1.5 11 397---> vim cond-a.sh
$ 4.1.5 12 398---> sh cond-a.sh
yes
$ 4.1.5 13 399---> vim cond-a.sh
$ 4.1.5 14 400---> cat cond-a.sh
if [ test -a ./a.out ]
then
echo yes
fi
$ 4.1.5 15 401---> vim cond-a.sh
$ 4.1.5 16 402---> sh cond-a.sh
test: 1: -a: unexpected operator
cond-a.sh: 5: 2: not found
$ 4.1.5 17 403---> vim cond-a.sh
$ 4.1.5 18 404---> sh cond-a.sh
cond-a.sh: 5: 0: not found
$ 4.1.5 19 405---> > a.out
$ 4.1.5 20 406---> sh cond-a.sh
cond-a.sh: 5: 0: not found
$ 4.1.5 21 407---> vim cond-a.sh
$ 4.1.5 22 408---> sh cond-a.sh
test: 1: -a: unexpected operator
$ 4.1.5 23 409---> vim cond-a.sh
$ 4.1.5 24 410---> sh cond-a.sh
test: 1: -a: unexpected operator
$ 4.1.5 25 411---> vim cond-a.sh
$ 4.1.5 26 412---> sh cond-a.sh a.out
yes
$ 4.1.5 27 413---> sh cond-a.sh a.outg
yes
$ 4.1.5 28 414---> sh cond-a.sh a.outg
yes
$ 4.1.5 29 414---> vim cond-a.sh
$ 4.1.5 30 415---> sh cond-a.sh a.outg
yes
$ 4.1.5 31 416---> vim cond-a.sh
$ 4.1.5 32 417---> sh cond-a.sh a.out
yes
$ 4.1.5 33 418---> sh cond-a.sh a.outj
yes
$ 4.1.5 34 419---> test -a a.out
$ 4.1.5 35 420---> echo $?
0
$ 4.1.5 36 421---> rm a.out
$ 4.1.5 37 422---> test -a a.out
$ 4.1.5 38 423---> echo $?
1
$ 4.1.5 39 424--->

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s