documentation refactoring
This commit is contained in:
70
docs/shells/bash.md
Normal file
70
docs/shells/bash.md
Normal file
@@ -0,0 +1,70 @@
|
||||
# Bash
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
script_directory="$(dirname "$(readlink -f "$0")")"
|
||||
#simbolo para comentário
|
||||
if <condition>; then
|
||||
<commands>
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if test $variavel -eq 3; then
|
||||
echo
|
||||
fi
|
||||
|
||||
|
||||
if [ $variavel -eq 3 ]; then
|
||||
echo
|
||||
fi
|
||||
|
||||
if [ ! $variavel -eq 3 ]; then
|
||||
echo
|
||||
fi
|
||||
|
||||
if [ $variavel -eq 3 -a $variavel -eq 2 -o $variavel -eq 1]; then
|
||||
echo
|
||||
fi
|
||||
``
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
function echoArguments(){
|
||||
echo "printing ($#) arguments"
|
||||
for ARGUMENT in "$@"
|
||||
do
|
||||
echo $ARGUMENT
|
||||
done
|
||||
}
|
||||
echoArguments $@
|
||||
Também é possível aceder por índice
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
function echoArguments(){
|
||||
echo "$0"
|
||||
echo "$1"
|
||||
}
|
||||
echoArguments $@
|
||||
Testar se um programa está a correr
|
||||
if pgrep jivelite>/dev/null
|
||||
then echo "a correr"
|
||||
else echo "nao esta correr"
|
||||
fi
|
||||
verifica o numero de parametros
|
||||
cuidado tem que ter mesmo os espaços nos parenteses rectos
|
||||
|
||||
if [ "$#" -ne 2 ]
|
||||
then
|
||||
echo "wrong number of parameters($#)"
|
||||
echo "0 - name of processo to search"
|
||||
echo "1 - commando to start"
|
||||
exit 1
|
||||
fi
|
||||
``
|
||||
|
||||
61
docs/shells/zsh.md
Normal file
61
docs/shells/zsh.md
Normal file
@@ -0,0 +1,61 @@
|
||||
# zsh / ohmyzsh
|
||||
|
||||
## Install
|
||||
|
||||
**Sources**
|
||||
https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH
|
||||
|
||||
### Debian/Ubuntu
|
||||
|
||||
``` bash
|
||||
sudo apt install zsh
|
||||
```
|
||||
|
||||
### Fedora
|
||||
|
||||
``` bash
|
||||
dnf install zsh
|
||||
|
||||
# Make it default shell
|
||||
sudo lchsh $USER
|
||||
```
|
||||
|
||||
### ohmyzsh
|
||||
|
||||
#### Install
|
||||
|
||||
``` bash
|
||||
|
||||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
||||
|
||||
```
|
||||
|
||||
## Plugins
|
||||
|
||||
Currenty testing
|
||||
|
||||
* git
|
||||
* web-search
|
||||
* timer
|
||||
|
||||
|
||||
## themes
|
||||
|
||||
- <https://github.com/EliverLara/Nordic>
|
||||
|
||||
### shell
|
||||
|
||||
- zsh
|
||||
|
||||
```bash
|
||||
sudo apt install zsh
|
||||
chsh -s /bin/zsh $whoami
|
||||
sudo apt-get install fonts-powerline
|
||||
|
||||
#source https://ohmyz.sh/#install
|
||||
ssh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
|
||||
|
||||
#~/home/.zshrc
|
||||
#ZSH_THEME="agnoster"
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user