Edit shell script while it’s running

It does affect, at least bash in my environment, but in very unpleasant way. See these codes. First a.sh: #!/bin/sh echo “First echo” read y echo “$y” echo “That’s all.” b.sh: #!/bin/sh echo “First echo” read y echo “Inserted” echo “$y” # echo “That’s all.” Do $ cp a.sh run.sh $ ./run.sh $ # open … Read more

Can a shell script set environment variables of the calling shell? [duplicate]

Use the “dot space script” calling syntax. For example, here’s how to do it using the full path to a script: . /path/to/set_env_vars.sh And here’s how to do it if you’re in the same directory as the script: . set_env_vars.sh These execute the script under the current shell instead of loading another one (which is … Read more

How to determine the current interactive shell that I’m in (command-line)

There are three approaches to finding the name of the current shell’s executable: Please note that all three approaches can be fooled if the executable of the shell is /bin/sh, but it’s really a renamed bash, for example (which frequently happens). Thus your second question of whether ps output will do is answered with “not … Read more

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