Artificial intelligent assistant

How to redirect stderr in busybox? I have BusyBox v1.27.1 (2017-08-03 03:14:35 CEST) built-in shell (ash) on router. I found a weird issue: root@DD-WRT:/# echo -n "Hi" 2>/dev/null -sh: 2: Invalid argument Seems I cannot redirect stderr. Is this a common known thing? Or a bug? Is there some alternative to redirecting stderr?

It's a DD-WRT bug, and it was fixed in August 2019.

* A `F_DUPFD_CLOEXEC` parameter to the `fcntl()` function has been available since Linux 2.6.24 in 2008.
* Busybox's Almquist shell started using it ten years later in 2018, for parts of enacting shell redirections.
* But the Linux 2.6 supplied in DD-WRT on some routers was Linux 2.6. **23**.



The fix was to backport support for `F_DUPFD_CLOEXEC` into DD-WRT's Linux 2.6.

# Further reading

* doktornotor (2017-03-26). _Busybox - Invalid argument since r31533 Broadcom K2.6_. DD-WRT bug #5784.
* Denys Vlasenko (2018-03-30). _ash: use`F_DUPFD_CLOEXEC` and `O_CLOEXEC`_. Busybox git.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy d4b08fc8a0d00d39813d1a4680e89b46