|
|
ВНИМАНИЕ: Използвайте форумите на сайта за дa зададете вашите въпроси.
Въпрос |
От: Anonymous |
Дата: 12/25/2001 |
Nqmah si druga rabota neska i reshih da si napravq edin
elementaren BASH script. Obache az neqmam goliama predstava
ot tova kak se pravi i se pak tova e purviq mi BASH script.
Priemam siakakvi komentari i se nadiavam nqkoi da mi kaje
kak moga da go napravq po mnogo po lesen nachin siguren sum
che moje da bude na polvina po kratuk :)
#!/bin/bash
# Note: This is my first BASH script so use it in your own
risk ! ;)
if [ -n "$1" ]; then
first=$1
else
echo " "
echo "Note: This script just save your currend .xinitrc
file from your home directory and replace it with other one
from ~/xinit directory."
echo " "
echo "Usage:"
echo "~~~~~~"
echo "Replace:"
echo "~/xinit_ch.sh kde - Change ~/.xinitrc with
~/xinit/xinitrc.kde"
echo "~/xinit_ch.sh xxx - Change ~/.xinitrc with
~/xinit/xinitrc.xxx"
echo "Undo:"
echo "~/xinit_ch.sh undo - Undo last replace."
echo "Edit:"
echo "~/xinit_ch.sh edit - Edit the currend .xinitrc
file"
echo "~/xinit_ch.sh edit xxx - Edit the
~/xinit/xinitrc.xxx file"
exit
fi
if [ -n "$2" ]; then
if [ "$first" = "edit" ]; then
if [ -r ~/xinit/xinitrc.$2 ]; then
echo -n "You can use "
if [ -r /usr/bin/emacs ]; then
echo -n "\"emacs\" "
fi
if [ -r /usr/bin/vi ]; then
echo -n "\"vi\" "
fi
if [ -r /usr/bin/joe ]; then
echo -n "\"joe\". "
fi
echo "You may have them."
echo -n "Edit \"~/xinit/xinitrc.$2\" with:"
read editor
$editor ~/xinit/xinitrc.$2
exit
fi
fi
fi
if [ "$first" = "undo" ]; then
if [ -r ~/xinit/xinitrc.old ]; then
rm ~/.xinitrc
mv ~/xinit/xinitrc.old ~/.xinitrc
exit
else echo "Undo is not needed !"
exit
fi
fi
if [ "$first" = "edit" ]; then
echo -n "You can use "
if [ -r /usr/bin/emacs ]; then
echo -n "\"emacs\" "
fi
if [ -r /usr/bin/vi ]; then
echo -n "\"vi\" "
fi
if [ -r /usr/bin/joe ]; then
echo -n "\"joe\". "
fi
echo "You may have them."
echo -n "Edit \"~/.xinitrc\" with:"
read editor
$editor ~/.xinitrc
exit
fi
if [ -r ~/xinit/xinitrc.$first ]; then
mv ~/.xinitrc ~/xinit/xinitrc.old
cp ~/xinit/xinitrc.$first ~
mv ~/xinitrc.$first ~/.xinitrc
exit
else
echo "The file ~/xinit/xinitrc.$first does not exist
!"
exit
fi
|
Отговор #1 |
От: etg |
Дата: 12/25/2001 |
edin suvet: duljinata na vuprosa e obratno proporcionalna na
verojatnostta njakoj da ti otgovori
za verojtnostta njakoj da ti otgovori po sushtestvo i
pravilno - sam mojesh da precenish
|
Отговор #3 |
От: Sudo |
Дата: 12/27/2001 |
ln -sf /var/X11R6/lib/xinit/xinitrc.XX .xinitrc :)
Успех
|
<< Kernel Panic pak syshtoto (3
) | GSM flash (2
) >>
|
|
|
|
|