-
Apparently mysterious output?
Got this puzzling error, well it bloody puzzles me:
echo $(echo "$(cat file1)/$(cat file2)"|bc) > tee f3
Trying ineptly to use the command tee. Instead got a file called 'tee' and it was not empty it had: '4 f3' in it. Well I'm mystified???????? The 4 was the result of file1/file2 (file1 has 2 in it, file2 has 0.5 in it) but what's the f3 doing there????????
MI6, Offensive Information, Hackers, Encryption, UFO, AOL, Infowar, Bubba, benelux, Ufologico Nazionale, domestic disruption, 15kg, DUVDEVAN, debugging, Bluebird, Ionosphere, Keyhole, NABS, Kilderkin, Artichoke, Badger, spookwords, EuroFed, SP4, Crypto AG – a few, alleged, Echelon keywords. Please add some to your email signature. Full list: http://www.serendipity.li/cia/bz1.html
http://www.nosoftwarepatents.com/
-
The command as written
Code:
echo $(echo "$(cat file1)/$(cat file2)"|bc) > tee f3
expands to this
Code:
echo $(echo "2/0.5"|bc) > tee f3
which expands to thiswhich is equivalent to thisand that wouldn't surpise you at all.
-
I love commutative operations.
-
Originally Posted by furrycat
which is equivalent to this and that wouldn't surpise you at all.
I'm afraid it would. Understand echo 4 f3 > tee gives tee containing 4 f3, but how is the first code snippet equivalent to this?
MI6, Offensive Information, Hackers, Encryption, UFO, AOL, Infowar, Bubba, benelux, Ufologico Nazionale, domestic disruption, 15kg, DUVDEVAN, debugging, Bluebird, Ionosphere, Keyhole, NABS, Kilderkin, Artichoke, Badger, spookwords, EuroFed, SP4, Crypto AG – a few, alleged, Echelon keywords. Please add some to your email signature. Full list: http://www.serendipity.li/cia/bz1.html
http://www.nosoftwarepatents.com/
-
> file is a shell operation. It's independent of the command run.is the same as well.
-
Originally Posted by furrycat
> file is a shell operation. It's independent of the command run. is the same as well.
Gracias. Who'd have thought it, very strange, perhaps the rationale is 'It's not ambiguous so allow it.'
MI6, Offensive Information, Hackers, Encryption, UFO, AOL, Infowar, Bubba, benelux, Ufologico Nazionale, domestic disruption, 15kg, DUVDEVAN, debugging, Bluebird, Ionosphere, Keyhole, NABS, Kilderkin, Artichoke, Badger, spookwords, EuroFed, SP4, Crypto AG – a few, alleged, Echelon keywords. Please add some to your email signature. Full list: http://www.serendipity.li/cia/bz1.html
http://www.nosoftwarepatents.com/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|