Difference between revisions of "Linux Januar 2012/Menu"
From Teknologisk videncenter
m (Created page with "<source lang=cli> ** 24 januar 2012 ************************************ bruger12 ******* NET-KOM AFDELING ** FreeBSD ...") |
m |
||
Line 26: | Line 26: | ||
</Source> | </Source> | ||
+ | == Menu eksempel == | ||
+ | <div style="margin: 10px 100px"> | ||
+ | <source lang="bash"> | ||
+ | #!/usr/bin/bash | ||
+ | # | ||
+ | # Dette er en kommentarlinier | ||
+ | # | ||
+ | # Bla Bla | ||
+ | # | ||
+ | ######## | ||
+ | |||
+ | |||
+ | LOOP="yes" | ||
+ | |||
+ | while test $LOOP == "yes" | ||
+ | do | ||
+ | |||
+ | clear | ||
+ | echo -en " BRUGER MENU: | ||
+ | |||
+ | 1: Online brugere. | ||
+ | 2: Diskplads brugere | ||
+ | 3: | ||
+ | |||
+ | -: Afslut | ||
+ | |||
+ | Indtast valg: " | ||
+ | |||
+ | read VALG | ||
+ | |||
+ | case $VALG in | ||
+ | 1) clear | ||
+ | echo -en " B R U G E R E L O G G E T I N D " | ||
+ | finger | less -P"Tast q for at afslutte" | ||
+ | ;; | ||
+ | 2) clear | ||
+ | echo -e " DISKPLADS FORBRUG BRUGERBASERET" | ||
+ | echo -e " =================================\n" | ||
+ | cd /home | ||
+ | du -ks * 2>/dev/null | sort -rn | less -P"Tast q for at afslutte" | ||
+ | ;; | ||
+ | 3) clear | ||
+ | echo -e "Dette menupunkt er ikke udviklet endnu" | ||
+ | echo -en "\n Tast <ENTER> for at fortsaette." | ||
+ | read DUMMY | ||
+ | |||
+ | ;; | ||
+ | -) LOOP=no | ||
+ | ;; | ||
+ | *) echo "\x07" | ||
+ | ;; | ||
+ | esac | ||
+ | done | ||
+ | </source> | ||
+ | </div> | ||
+ | [[Category:Linux]] |
Latest revision as of 13:17, 24 January 2012
** 24 januar 2012 ************************************ bruger12 *******
NET-KOM AFDELING
** FreeBSD *********************************** SYSTEMMENU****
1: Vis brugere der er logget ind
2: Vis systembelastning (top)
3: Vis harddisk plads
4: Vis brugernes forbrug af diskplads
5: Start mail (pine)
6: Skriv i systemlog
7: Udskriv systemlog
9: Udgang til shell (bash)
-: Afslut menu
Indtast valg:
Menu eksempel
#!/usr/bin/bash
#
# Dette er en kommentarlinier
#
# Bla Bla
#
########
LOOP="yes"
while test $LOOP == "yes"
do
clear
echo -en " BRUGER MENU:
1: Online brugere.
2: Diskplads brugere
3:
-: Afslut
Indtast valg: "
read VALG
case $VALG in
1) clear
echo -en " B R U G E R E L O G G E T I N D "
finger | less -P"Tast q for at afslutte"
;;
2) clear
echo -e " DISKPLADS FORBRUG BRUGERBASERET"
echo -e " =================================\n"
cd /home
du -ks * 2>/dev/null | sort -rn | less -P"Tast q for at afslutte"
;;
3) clear
echo -e "Dette menupunkt er ikke udviklet endnu"
echo -en "\n Tast <ENTER> for at fortsaette."
read DUMMY
;;
-) LOOP=no
;;
*) echo "\x07"
;;
esac
done