# export PS1="\[\033[m\][\[\033[1;35m\]\t\[\033[m\]] \[\e[2m\]\u\[\e[1;36m\]\[\033[m\]@\[\e[1;36m\]\h\[\033[m\]:\[\e[0m\]\[\e[1;32m\]\W\[\e[0m\]\[\e[2m\]\$ \[\e[0m\]"
-#
-# # ex - archive extractor
-# # usage: ex <file>
-ex ()
-{
- if [ -f $1 ] ; then
- case $1 in
- *.tar.bz2) tar -xvjf $1 ;;
- *.tar.gz) tar -xvzf $1 ;;
- *.bz2) bunzip2 $1 ;;
- *.rar) unrar x $1 ;;
- *.gz) gunzip $1 ;;
- *.tar) tar -xvf $1 ;;
- *.tbz2) tar -xvjf $1 ;;
- *.tgz) tar -xvzf $1 ;;
- *.zip) unzip $1 ;;
- *.Z) uncompress $1;;
- *.7z) 7z x $1 ;;
- *) echo "'$1' cannot be extracted via ex()" ;;
- esac
- else
- echo "'$1' is not a valid file"
- fi
-}
-
# User defined aliases
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
--- /dev/null
+# $1: file to extract
+ex ()
+{
+ if [ -f $1 ] ; then
+ case $1 in
+ *.tar.bz2) tar -xvjf $1 ;;
+ *.tar.gz) tar -xvzf $1 ;;
+ *.bz2) bunzip2 $1 ;;
+ *.rar) unrar x $1 ;;
+ *.gz) gunzip $1 ;;
+ *.tar) tar -xvf $1 ;;
+ *.tbz2) tar -xvjf $1 ;;
+ *.tgz) tar -xvzf $1 ;;
+ *.zip) unzip $1 ;;
+ *.Z) uncompress $1;;
+ *.7z) 7z x $1 ;;
+ *) echo "'$1' is not supported" ;;
+ esac
+ else
+ echo "'$1' is not a file"
+ fi
+}
+
## Shell(s)
I use bash on Lunux and zsh on MacOS, therefore I have and RC for both of them. Their design are similar: they define a prompt and some simple functions and include:
-- `~/.*sh_aliases`: a file in which the user can insert additional aliases without changing the RC file. Additional aliases are not included for non-interactive shells;
-- `~/.*sh_env`: a file in which the user is supposed to insert the environment variables or exports without changing the RC file. Since every system is different, the file is not included in the repository.
+- `~/.*sh_aliases`: it defines simple cross machine alases (evaluated from \*shrc);
+- `~/.*sh_env`: contanins definitions for machine specific environment variables (evaluated from \*shrc);
+- `~/.config/some.files/bash/env.sh`: contains definitions for cross machine environment variables (evaluated from .bashrc);
+- `~/.config/some.files/bash/procedures/*.sh`: each file is evaluated from .bashrc and is supposed to contain definitions for bash procedures;
### Dependencies