Funny BASH snippets

echo howdy
/bin/echo howdy
/bin/../bin/echo howdy

/bin/echo* howdy
cd /bin
echo* howdy
*echo howdy
ec*ho howdy
ech? howdy
??h? howdy
ech[o] howdy
cd /tmp

ec${howdy}ho howdy
echo$howdy howdy

ec''ho howdy
ec""ho howdy
'ec'ho howdy
"ec"ho howdy
'echo' howdy
"echo" howdy
ech\o howdy

ec``ho howdy
ec$()ho howdy
ec`true`ho howdy
ec$(true)ho howdy

$yay echo howdy
`` echo howdy
`true` echo howdy
`echo echo` howdy

:&echo howdy
if echo howdy;then :;else echo howdy;fi
! echo howdy
{ echo howdy ;}
(echo howdy)
eval echo howdy
xargs echo howdy < /dev/null
sh -c 'echo howdy'
bash -c 'echo howdy'
ssh localhost 'echo howdy'

cd /tmp
printf "all:\n\techo howdy" > Makefile
make

cd /tmp
echo echo howdy > bash
chmod +x bash
./bash

cd /tmp
cp /bin/bash bash
echo echo howdy > bash
./bash
. ./bash
bash bash
PATH=. bash

alias howdy='echo howdy; unalias howdy'
howdy

PROMPT_COMMAND='echo howdy; unset PROMPT_COMMAND'

# simple regex (Chomsky type-3) can not parse type-2 grammar:
echo $(echo y|tr "$(echo "y|x")" x)

Comments

Popular posts from this blog

Hidden TFTP of TP-Link routers

Tftp secret of TL-WR740N uncovered

When both Google *and* AppStatus is down