12.07.2015 Views

Operating Systems - 0132410 – הלעפה תוכרעמ 'עשת"א סמסטר ב Spring ...

Operating Systems - 0132410 – הלעפה תוכרעמ 'עשת"א סמסטר ב Spring ...

Operating Systems - 0132410 – הלעפה תוכרעמ 'עשת"א סמסטר ב Spring ...

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

when the shell is invoked as:myshell1 filename Reuven Mordo Aviv Shalomand it encounters the lineecho Prof. $1 $3in the file, it should executesystem(“echo Prof. Reuven Aviv”) which in turn outputs:Prof. Reuven Avivecho $5should cause an appropriate error message in the standard error4) Perform environment variable substitution on its commands:For instance if the value of the environment variable HOME is/home/cmshalom, and the value of the environment variableTERM is vt100 then:• when the commandcd $HOMEis entered by the user, the current working directory becomes/home/cmshalom.• when the commandpause $TERMis entered by the user, myshell displays vt100 to the standardoutput and wait for the enter to be pressed. 15) Modularization: Separate the program into a set of coherentmodules (i.e. *.c and *.h files)Testing: Test your shell with the sample command file publishedseparately and make sure that you get the correct output (alsopublished).Good Luck !!1 Read about the getenv() function. (man getenv)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!