man bash - Read it! It’s worth your time.
$HOME/.bashrc is executed when Bash starts. Add stuff you want to keep for every session (like Completion or Silence). Don’t want to restart Bash? Then source it with run source ~/.bashrc.
man says “Read and execute commands from filename in the current shell environment and return the exit status of the last command executed from filename.”. The following lines are equivalent:
source some_file
. some_file
These line activate Bash completion:
if [[ -f /etc/bash_completion ]]; then
. /etc/bash_completion
fi
You may want to install bash-completion and python-optcomplete.
1 2 3 4 | #!/bin/bash
x="hello"
echo "$x world"
echo '$x world'
|
Simply copy and paste it to your running Bash session and see what happens.
1 2 3 | echo "This file: $0"
echo "Absolute path of this file: $(readlink -f $0)"
echo "Absolute path of this file's parent directory: $(dirname $(readlink -f $0))"
|
Simply copy and paste it to your running Bash session and see what happens.