How can I declare and use Boolean variables in a shell script?

Revised Answer (Feb 12, 2014) the_world_is_flat=true # …do something interesting… if [ “$the_world_is_flat” = true ] ; then echo ‘Be careful not to fall off!’ fi Original Answer Caveats: https://stackoverflow.com/a/21210966/89391 the_world_is_flat=true # …do something interesting… if $the_world_is_flat ; then echo ‘Be careful not to fall off!’ fi From: Using boolean variables in Bash The reason … Read more

How to specify the private SSH-key to use when executing shell command on Git?

None of these solutions worked for me. Instead, I elaborate on @Martin v. Löwis ‘s mention of setting a config file for SSH. SSH will look for the user’s ~/.ssh/config file. I have mine setup as: Host gitserv Hostname remote.server.com IdentityFile ~/.ssh/id_rsa.github IdentitiesOnly yes # see NOTES below And I add a remote git repository: … Read more

Difference between sh and Bash

What is sh? sh (or the Shell Command Language) is a programming language described by the POSIX standard. It has many implementations (ksh88, Dash, …). Bash can also be considered an implementation of sh (see below). Because sh is a specification, not an implementation, /bin/sh is a symlink (or a hard link) to an actual … Read more

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