python -c vs python –

The main flaw of using a here document is that the script’s standard input will be the here document. So if you have a script which wants to process its standard input, python -c is pretty much your only option. On the other hand, using python -c ‘…’ ties up the single-quote for the shell’s … Read more

Using find command in bash script

Welcome to bash. It’s an old, dark and mysterious thing, capable of great magic. 🙂 The option you’re asking about is for the find command though, not for bash. From your command line, you can man find to see the options. The one you’re looking for is -o for “or”: list=”$(find /home/user/Desktop -name ‘*.bmp’ -o … Read more

curl 302 redirect not working (command line)

You need to supply the -L or –location option in order to enable curl to follow HTTP redirects. Quoting from man curl: -L, –location (HTTP/HTTPS) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code), this option will make curl redo … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)