Get pid of current subshell

Modern bash If you are running bash v4 or better, the PID of the subshell is available in $BASHPID. For example: $ echo $$ $BASHPID ; ( echo $$ $BASHPID ) 32326 32326 32326 1519 In the main shell, $BASHPID is the same as $$. In the subshell, it is updated to the subshell’s PID. … Read more

sh read command eats backslashes in input?

Accrding to: http://www.vias.org/linux-knowhow/bbg_sect_08_02_01.html : -r If this option is given, backslash does not act as an escape character. The backslash is considered to be part of the line. In particular, a backslash-newline pair may not be used as a line continuation. It works on my machine. $ echo ‘\&|’ | while read -r in; do … Read more

git with –git-dir= results in ‘not a git repository’

When using –git-dir, you need to point at the .git folder of your repository. Try: git –git-dir=projectDirPath/.git show -s –pretty=format:%h The doc on –git-dir says that: –git-dir= Set the path to the repository (“.git” directory). This can also be controlled by setting the GIT_DIR environment variable. It can be an absolute path or relative path … Read more

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