confused about variables in bash

Posted by gappy on Super User See other posts from Super User or by gappy
Published on 2014-06-05T20:54:05Z Indexed on 2014/06/05 21:28 UTC
Read the original article Hit count: 327

Filed under:
|

I know that variables in bash have no type, but am confused about the value they are assigned.

The following simple script works fine in bash

#!/bin/bash 
tail -n +2 /cygdrive/c/workdir\ \(newco\,\ LLC\)/workfile.txt > \
/cygdrive/c/workdir\ \(newco\,\ LLC\)/workfile2.txt

However, the following does not

#!/bin/bash
tmpdir=/cygdrive/c/workdir\ \(newco\,\ LLC\)
tail -n +2 $tmpdir/workfile.txt > $tmpdir/workfile2.txt

Is there an explanation for this behavior?

© Super User or respective owner

Related posts about bash

Related posts about variables