Re: [PATCH v2] Test t5560: Fix test when run with dash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tarmigan Casebolt schrieb:
>         REQUEST_METHOD="GET" some_shell_function

> I can't tell from my reading of the POSIX spec whether my usage was
> wrong or if dash is wrong,

According to POSIX, variables set as shown above for shell functions are
not exported and retain their value after the function returns. I would
not be surprised if dash got this right, and the tests fail because they
were written for bash, which gets it wrong.

In particular,

f() { sh -c 'echo +$v+'; }
v=x f
echo +$v+
sh -c 'echo +$v+'"

Should print

++
+x+
++

I can test only ash, bash, zsh, and ksh, of which only ksh gets it right.

-- Hannes

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]