Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

String concatenation does not work in Bash cygwin

Tell me this, why this code does not work in Cygwin ? I've tried use \. and different symbol combinations between variable. Scopes tried too ( round, figure ). Dunno what up.

My code is here and it WORKS !!!: http://ideone.com/0tLmzu

NOTE: I just trying to concatenate two strings in one, but Cygwin can't do that. Example below:

echo $a$b prints only $b, not $a and $b

like image 548
Vladislav Romarov Avatar asked Aug 01 '26 13:08

Vladislav Romarov


1 Answers

I believe I know what this is. The file is a dos file and not unix. If you use vim you can:

vim file
:set ff=unix
:x

Or if you do not want to use vim, this from the command line:

dos2unix file
like image 92
cforbish Avatar answered Aug 04 '26 03:08

cforbish



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!