BASH: Make the same files tree with other extension

… using ‘find’. The issue is making same tree files in other directory with other extension,
in my case is making js-behaviors tree for templates.
Also have a two directories assets/app/dialogs (current directory) and templates/dialogs.
Prepare current directory. Next shell make the same directory tree:
$ find ../../../templates/dialogs/ -mindepth 1 -type d \ -exec sh -c "mkdir -p \${0:27}" {} \;
Continue reading

BASH: Unescape url-encoded string

It’s actually simple: $ export ESCAPED="%D1%80%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9+%D1%82%D0%B5%D0%BA%D1%81%D1%82%2C+fuf" $ echo "$(echo -e "$(echo "$ESCAPED" | sed 's/+/%20/g' | sed 's/%/\\x/g')")" русский текст, fuf
In practice, for example, using with url decoding: $ function urldecode() { echo "$(echo -e "$(echo "$1" | sed 's/+/%20/g' | sed 's/%/\\x/g')")"; } $ urldecode "http%3A%2F%2Fbash.im%2F" http://bash.im/ Wuala.