Tweet |
Follow @linuxawi_com |
افتح الطرفيه
sudo aptitude install fortune cowsay
حرر هذا الملف
sudo gedit /etc/bash.bashrc
وأضف في نهايته هذه الاسطر
# Spicing up Terminal
fortune | cowsay -n -f tux.cow
echo
fortune | cowsay -n -f tux.cow
echo
احفظ واغلق
افتح الطرفية وتمتع بالنتيجة
يمكنك تغيير صورة البطريق استعرض ماهو موجود
ls /usr/share/cowsay/cows/
تستطيع تجربتهم مثال:
fortune | cowsay -n -f gnu.cow
- في الطريقة السابقة تتغير الحكمة ولا تتغير الصورة
إذا أردت يمكنك جعل الحكمة والصورة تتغير كل ماقمت بفتح الطرفية
حرر الملف
sudo gedit /etc/bash.bashrc
وأضف فيه التالي
#!/bin/bash
# The following can be added to the end of ~/.bashrc or /etc/bash.bashrc
# to generate random, amusing welcome text with each logon.
# Check for interactive terminal (should not produce output otherwise).
if [ "$PS1" ]; then
# Set location of cow files.
cowdir="/usr/share/cowsay/cows"
# Create an array from the files in our $cowdir.
cows=($cowdir/*)
# Randomly select a cow from our cows
# (${#myarr[*]} == num items in array, RANDOM == random number).
mycow="${cows[RANDOM % ${#cows[*]}]}"
# Create an array of possible cow actions (think or say).
cowactions=("cowsay" "cowthink")
# Randomly select an action.
myaction="${cowactions[RANDOM % ${#cowactions[*]}]}"
# Call fortune and pass the results to cowthink/cowsay with our chosen cow.
fortune | $myaction -n -f "`basename ${mycow}`"
fi
# The following can be added to the end of ~/.bashrc or /etc/bash.bashrc
# to generate random, amusing welcome text with each logon.
# Check for interactive terminal (should not produce output otherwise).
if [ "$PS1" ]; then
# Set location of cow files.
cowdir="/usr/share/cowsay/cows"
# Create an array from the files in our $cowdir.
cows=($cowdir/*)
# Randomly select a cow from our cows
# (${#myarr[*]} == num items in array, RANDOM == random number).
mycow="${cows[RANDOM % ${#cows[*]}]}"
# Create an array of possible cow actions (think or say).
cowactions=("cowsay" "cowthink")
# Randomly select an action.
myaction="${cowactions[RANDOM % ${#cowactions[*]}]}"
# Call fortune and pass the results to cowthink/cowsay with our chosen cow.
fortune | $myaction -n -f "`basename ${mycow}`"
fi
8O
:mrgreen :





Nice
حلوة
لكني حطيته ووأدي أرجعه كما كانت لكن ماعرفت
فقط تراجع عن الخطوات اللي قمت بها
احذف الحزم اللي ركبتهم بالأمر التالي
وبعدها احذف ما أضفته على ملف bash.bashrc
الله يعافيك على الإجابة بسرعة
لكن يمكنني التراجع عن الخطوات التي قمت بها
لان قمت بإغلاق الطرفية ومن ثم فتحتها من جديد
انما عمل كل هذه الاشياء وانا جديد فى الاوبنتو واللينوكس عموما بس لم يظهر لى اى صور ويكتب لى عند بدايه الطرفيه :
bash: /etc/bash.bashrc: line 26: syntax error near unexpected token `(‘
bash: /etc/bash.bashrc: line 26: `fi# System-wide .bashrc file for interactive bash(1) shells.’
مش عارف اعمل ايه؟؟
:cwy:
لديك خطأ في السطر 26 في ملف bash.bashrc هذه معنى الرسالة
هل نصبت الحزم اللازمة fortune cowsay