Sabtu, 18 Januari 2014

Example For Shell Linux


Ok, may be many people are learn about shell linux

here I will share, look and you mmust understand

#!/bin/bash

function pewed()
{
pwd
}

function els()
{
ls
}

function lognamee()
{
logname
}

function Dir()
{
echo "Input directory name : "
read a
mkdir $a
}

function File()
{
echo "input file name : "
read a
cat >>$a
}

function delete()
{
echo "input file name/ directory, you want to delete : "
read a
rm -r $a
}

function auxe()
{
ps aux
}

function greep()
{
grep |lspci
}

function ter()
{
echo "Input Word : "

read big

echo " "
echo "result : "
echo " "
echo $big | tr '[:upper:]' '[:lower:]'
echo $big | tr '[:lower:]' '[:upper:]'
}

function th()
{
echo "input name file : "
read a
touch a
}

repeat='y'
while [ $repeat == 'y' ] || [ $repeat == 'Y' ]
do
clear
echo "================================================"
echo "===================Menu========================="
echo "================================================"

echo "1. Function Pwd"
echo "2. Function ls"
echo "3. Function Logname"
echo "4. Function create Directory"
echo "5. Function create file"
echo "6. Function delete File/Direktori"
echo "7. Function Ps Aux"
echo "8. Function grep"

echo "9. Function Touch"
echo "10. Function tr"
echo "================================================"
echo " Please choice "
read e

case $e in
1) pewed;;
2) els;;
3) lognamee;;
4) Dir;;
5) File;;
6) delete;;
7) auxe;;
8) greep;;
9) th;;
10) ter;;

esac
echo "You want to reset?(y/t)"
read repeat
done
while [ $repeat != y ] || [ $repeat != y ]
do
exit 0
done


Tidak ada komentar:

Posting Komentar