Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6168

Difference between tcsh and bsd-csh in terms of use of square brackets in echo

$
0
0

I have two simple Shell scripts that essentially do the same thing (i.e., printing all arguments), as are shown below.

S1:

#!/usr/bin/tcshecho [$argv[*]]

S2:

#!/usr/bin/bsd-cshecho [$argv[*]]

S1 runs OK on Ubuntu as a tcsh script:

% ./S1 a b[a b]

But S2 fails on Ubuntu as a bsd-csh script:

% ./S2 a becho: No match.

I know S2 can be fixed by a pair of double quotes around [$argv[*]], yet I'd like to know what leads to the different results in tcsh and bsd-csh. If possible, please provide links to documentation that help explain cause of the different results. Thanks in advance.


Viewing all articles
Browse latest Browse all 6168

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>