الانتقال إلى المحتوى
View in the app

A better way to browse. Learn more.

مجموعة مستخدمي أوراكل العربية

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

مساعدة في مشروع Simple Shell Program

Featured Replies

بتاريخ:

رجوا من سيادتكم المساعدة في مشروع Simple Shell Program على نظام لينكس linux



Project1: Simple Shell Program
Develop a c/c++ program which serve as s shell interface that accept user command and then execute each command in separate process. The shell interface provides a user prompt ( sh> ) after which next command is entered .
#define TRUE 1
while(TRUE){ //repeat forever
type_prompt(); //display prompt on the screen
read_command (command, parameters); //read input from terminal
if(fork()!=0){ //fork off child process
waitpid(‐1, &status, 0); //wait for child to exit }
else{
execve(command, parameters, 0); //execute command }}
Write a shell that is similar to the above code snippet, but contains enough code that it actually works so you can test it. You might also add some features such as redirection of in input and output, pipes, and background jobs.
If the user enter “& “ at the end of his command, then the process (command) will be executed in the background and the shell WILL not WAIT it to terminate.
You can experience background process yourself by trying the following command on bash shell.
> kwrite
The kwrite application will be run, and the shell prompt will not prompted until you terminate kwrite. BUT if you tried the following command, then the prompt will return to the user to accept other commands while kwrite (child process) is running!
> kwrite & If the user entered exit command, then you will break the loop (exit(0)).
Here is an example of how your shell should work: (italics indicate typed commands)
% ./myshell
sh> echo hello world!
hello world!
sh > emacs test.txt &
process 3456 started
sh > mozilla &
process 3457 started
sh > cp test.txt newfile.txt
sh > exit



ولكم جزيل الشكر :D

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية

Account

Navigation

البحث

إعداد إشعارات المتصفح الفورية

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.