الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

الله يسعدكم مين يعرف بروقرامينق في السكريبت شل حق لينوكس ضرووووري

بدأه bunny في 21 مايو 2010 · 3 رد · 829 مشاهدة · في نظام تشغيل Unix & Linux
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ورحمة الله وبركاته

محتاااااااااجه مساعده ضروريه في البرمجه حق السكريبت شل لنظام لينكس

الله يسعدكم

بحكم دخولي على دا المنتدى دايما اشوف الأعضاء ماشاء الله خبرتهم عاليه

فأحتاج أحد يساعدني ضرووووووووووووري إختباري الفاينال حق المعمل الإثنين هذا بإذن الله والواجب تسليمو الأحد

حأكتب السؤال والأكواد هنا واحتاج أحد ضروري يصححلي ياها

لأنو حأذاكر منها إن شاء الله

الله يسعدكم دنيا وآخره يا أهل الخبره ردو عليا

بسم الله الرحمن الرحيم

دا السؤال

Create a file ‘Assignment‘ on the HOME directory and write a shell script do the following (based on the user choice) :

Choice 1: Check if a file exists in a specific directory. If the file exists display its content and check if the user is allowed to execute it, permit the user to execute the file, if he is not allowed. fie

# Display a menu of options and

# depending upon the user's choice,

#execute associated command

#Display the options to the users

If the file does not exist, display the file is not found and ask the user to reenter the name of the file and directory. Stop asking when the user enter “done” as a file name.

Choice 2: Read n numbers from the user, calculate how many even or odd numbers entered then display the results.

ودا جواب الإختيار الأول إلي هوا رقم واحد

echo

read choice

case $choice in

1) until echo

read fil_name && read dir_name

do

if [ $fil_name=done ];

then break

elif

[ -f ~/$dir_name/$fil_name ];

then cat ~/$dir_name/$fil_name && test -x ~/$dir_name/$fil_name && echo $?

if [test ! -x ];

then

chmod u+x $fil_name

fi

fi

fi

done

;;

2) epxr 1 + 2;;

*) wrong;;

esac

.

بيطلعلي غلط في إنتهاء الإف

اتمنى أحد يعمل تريس للبرنامج ويشوف إش المشكله لأاني أحس إنها من الجهاز ولا مو عارفه أنا كاتبه الكود غلط ولا صح

ودي إجابة السؤال التاني

echo -n "Enter a number: ”

read n

rem=$n % 2

if [ $rem -eq 0 ]

then

echo “$n is even"

else

echo “&n is odd”

fi

دا عاد مو عارفه إش السبب

يطلعلي غلط في الإلس

بلييييييييييييييز بلييييييييز أحد يرد عليا لاتدخلو على الموضوع من دون رد لأني بجد محتاجه مساعده عاجله

ومشكوره مقدما

#2

يا الله محد يبغى يساعد ......

:(

:(

:(

#3

this is a solution of Q2

If u still want the solution of Q1 re-explain it because I'm confused

#!/bin/tcsh
cat << End
this is a script read n numbers from the user "while number > 0", calculate how many even or odd numbers entered then display the results
End
set evenSum = 0
set oddSum = 0
set evenCount = 0
set oddCount = 0
set num = 1 
	while ($num != 0)
		echo -n "Enter number :"
		@ num = $<
		if (($num % 2) == 0)then
			@ evenSum = $evenSum + $num
			@ evenCount++
		else
			@ oddSum = $oddSum + $num
			@ oddCount++
		endif
	end
echo "you have entered $evenCount even number & the sum = $evenSum "
echo "you have entered $oddCount odd number & the sum = $oddSum "

I hope u did well

إذا كنت ذا رأي فكن ذا عزيمة *** فإن فساد الرأي أن تـتـرددا

#4
echo “&n is odd”
#I think it must be like this
echo "$n is odd"

تم تعديل هذه المشاركة بواسطة xsoh في 1 يونيو 2010 في 20:59

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…