[HELP] Single questions & Help Thread [n00b] (412)

367 Name: Anonymous Techie : 2022-02-08 02:53 ID:aEbAKL+9

Why does sh have a problem with "[["? How do I escape it?

ubuntu@ubuntu:/$ echo "2f0a0a" | if [[ "2f0a0a" =~ "2f" ]]; then echo "2f0a0a" | xxd -ps -r -; else echo "2f0a0a"; fi
/

ubuntu@ubuntu:/$ sh -c 'echo "2f0a0a" | if [[ "2f0a0a" =~ "2f" ]]; then echo "2f0a0a" | xxd -ps -r -; else echo "2f0a0a"; fi'
sh: 1: [[: not found
2f0a0a
ubuntu@ubuntu:/$
Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: