Funkcja w Bash
#FIRST METHOD
Hello () {
echo 'Hello Wordl'
}
Hello
#SECOND METHOD
function Hello {
echo 'Hello Wordl'
}
Hello
Restu Wahyu Saputra
#FIRST METHOD
Hello () {
echo 'Hello Wordl'
}
Hello
#SECOND METHOD
function Hello {
echo 'Hello Wordl'
}
Hello
#!/bin/bash
function greet {
echo "Hi there!"
}
greet
function_name () {
commands
}
#!/bin/bash
hello_world () {
echo 'hello, world'
}
killport(){
sudo kill -9 $(sudo fuser -n tcp $1 2> /dev/null);
}
Now put this function in your bash configuration file, eg ~/.bashrc and then run:
source ~/.bashrc