Am 2013-08-06 15:52, schrieb Martti Kühne:
mar77i@asus77i:~$ 0+445
-bash: 0+445: command not found
mar77i@asus77i:~$ a=(0+445)
mar77i@asus77i:~$ echo $a
0+445

holy crap, that's what happens. Weren't you looking for this instead:

mar77i@asus77i:~$ a=$(( 5554 - 1000 ))
mar77i@asus77i:~$ echo $a
4554

so, you're misusing bash's array syntax to concatenate a string with
the output from a useless cat.
Hmm, after writing this you could be using IFS=+, but then again,
you'd have nonsensical "subtractions" on the last two lines you
posted, unless... No, I just don't believe you set IFS=+-.
The most interesting thing I find that you keep prepending 'let' to
your assignments, presumaby FOR the BASIC look of it. NEXT. Enough of
this, pretty much because I know bash pretty well, I'd say it's
probably futile to try to review something as naturally ugly and
confusing as bash, but this indeed was pretty far off...

As i said, it is just a bunch of stackoverflow answers patched together by try-and-error. Thanks for pointing out, HOW ugly it is. I probably will start the C version very soon. ;)

--Markus

Reply via email to