On 06-03-17 14:18, Greg Wooledge wrote:
> You're misunderstanding.  In a math context, which you are creating here
> by using -eq, the word 'x' is interpreted as a variable name, which may
> contain another variable name, and so on, until finally an integer is
> discovered.

Thanks. Now that I know it, I can indeed find it in the docs.

I guess this means that actually test and [ are 'broken':

$ test "x" -eq "x" && echo "yes" || echo "no"
test: invalid integer 'x'
no

$ [ "x" -eq "x" ] && echo "yes" || echo "no"
[: invalid integer 'x'
no

I hope this won't be fixed, as I rely quite heavily on this behaviour,
lacking some other short 'is integer' test.

Cheers,
  Rob

-- 
-- Rob la Lau
--
-- Sysadmin en webdeveloper in ruste
--
--      web : https://ohreally.nl/
--      eml : r...@ohreally.nl
--

Reply via email to