[Project Assignment]

Your project is to implement a shell-alike application, which acts like the Terminal / Konsole application in Ubuntu. Upon startup, it should show a command line asking the user to enter a command, for instance:

>_

[Milestone 1] - Due Week 6
For your first milestone, you need to implement the basic functionality in your shell application. It should only respond to the exit command and it should terminate upon entering that command. Additionally, you need to add history support (using a key of your choice) - e.g. if the user presses the Up or DOwnarrow key, it should show the previous or next command in the terminal just like the real terminal does and auto-complete them in the terminal. Example:

>_ (pressing Up)
>ls_ (pressing Up)
>cat test.txt_ (pressing Down)
>ls_ (pressing Down)
>_

[Milestone 2] - Due Week 7
For your second milestone, you need to implement support for executing external commands. Your application should be able to execute commands just like the real terminal does. Example:

>cat test.txt
This is the contents of test.txt
>_


[Lab 4] Homework

1. Write a program that creates N child processes, where N is taken from the command line, and makes each child process with index I compute the total number of divisors of the number I*10 and return them. The parent process will read each result returned by the children and show them on screen.

* Example:
N=5, child 0 will compute the number of divisors of 0, child 1 will compute the number of divisors of 10, child 2 the number of divisors of 20 and so on. Parent returns: "for child 0, I found 4 divisors", "for child 1, I found 6 divisors", etc.

* Desired input:
./app N

* Example:
./app 5

2. Write a program that creates N child processes, where N is taken from the command line, and also receives a filename. The program takes the input file and splits it so that each child process with the index I will show the exact Ith part of the file.

* Example:
Input file is 100 bytes in size and N=5. Child 0 will display bytes from 0 to 19, child 1 from 20 to 39, child 2 from 40 to 59 and so on.

* Desired input:
./app N input_file

* Example call:
./app 5 input.txt


[Lab 5] Homework

1. Write a program that creates a child process and waits for an input command (it reads it from the standard input). a) If the command is "show filename.txt" (no quotes), then the parent process will read the file filename.txt entirely and send it to the child process; the child process will send back to the parent the number of total words in that file, and the parent will show that number on screen. b) If the command is "trim filename.txt" (no quotes), the parent will no longer read the file, instead the child process will send to the parent the last 10 lines from the file filename.txt and the parent will show those lines on screen.

2. Write a program that creates N child processes, where N is taken from the command line, and also receives a filename and an input string. The program takes the input file and splits it so that each child process with the index I will process exactly the Ith part of the file, as follows: each child will determine if its allocated data chunk contains the input string or not, and all positions where matches occur. If matches are found, it will write to a pipe the locations of all occurrences.

Requirements:
a) Use a SINGLE PIPE for communication between the parent and all children.
b) BONUS points will be awarded if you can figure out a way to avoid misses if a string has a partial match in two different child processes (e.g. for "testing this", "testing " is partially matched by the first process and "this" by the second).
c) You can use strstr() to determine occurrences in a child process if you'd like, although that's not the optimal approach.

* Example call:
./app 5 input.txt "Something to search for"
Found occurrence at position 123
Found occurrence at position 567


MILESTONES 3 & 4

ACIOBANITEI V. FLORIN
AMARIOAREI T. MARIUS-CATALIN
APETREI N. NICOLETA-IOANA
BARBU I. M. DUMITRU-LAURENTIU
BELBE I. VASILE
BILT G. V. GEORGE
BOANGHES S. COSMIN-ALEXANDRU
BOBERNAC S. TIMEEA
BORTUN D. T. ANDRA
BOT V. CRISTIAN-DANIEL
BUCHERT R. HANS-DRAGOS
BURDUSEL G. DORINA-ALEXANDRA
CENUSA S. MARIN
CIUCIU I. ALEXANDRU IONUT
CIURDEL G. ANA-MARIA
CIMPEAN P. CRISTIAN-NICOLAE
CISLARIU V. DRAGOS-IONUT
COCOCEANU I. OANA-MARIA
CONSTANTIN N. NICOLAE-VIOREL
COVACI D. ANA-MARIA
CRISCIU N. ALEXANDRU-SEBASTIAN
CSIKI A. ANDREI-GABRIEL
DISA P. CATALIN-BOGDAN
DOGARU S. FLORENTIN GABRIEL
DRAGANESCU V. VALENTIN-FLAVIAN
DUMA V. S. CLAUDIUS-IONUT
DUSTINTA I. M. CRISTIAN-NORBERT
FIAT N. FILIP-ALEXANDRU
FILIEVICI O. LARISA
FLOREA C. CONSTANTIN-CATALIN
FORASCU G. M. VICTOR-MIHAI
FRINCU T. TATIANA-MARIA
GOCIU V. ANDREI-MIHAI
GRIGORE E. CIPRIAN-LUCIAN
HOLDUNU G. CRISTIAN
HORNOIU S. MADALINA-DENISA
HORVAT F. TIMEA
ILES D. ALEXANDRA-LIGIA
ILYES R. A. ALEXANDRU
IMBRESCU C. ELENA-IOANA
IOVA A. G. ADRIAN-NICUSOR
IOVESCU C. RALUCA
IVANOIU I. ROBERT-CATALIN
KULIK G. KARINA
LATCU T. D. IZABELLA
LAPUSTE G. NICOLAE-ALEXANDRU
LATA G. ROXANA-TEODORA
LIVADARU C. CONSTANTIN-DAVID
LUNGU D. VLAD
MAGYAR A. C. TAMAS AUREL
MANEA C. S. RADU-CATALIN
MARIS V. MALVINA-AMEDEA
MARUSANICI G. LAURENTIU-DANIEL
MATEESCU H. D. ADINA-LENUTA-MARIA
MATIUTU D. SILVIU-DANIEL
MANESCU C. ANDREI-CRISTIAN
MARCUS E. ROMULUS-GEORGE
MIHAI C. ROBERT-CONSTANTIN
MILITARU G. KARINA-ROXANA
MIRESCU M. ALEXANDRU-CRISTIAN
NEATU I. OVIDIU-GABRIEL
NEGRU L. FLORINA LUCIANA
NITU V. STELIAN-ALIN
OLARASU D. DUMITRU-ADRIAN
OLTEANU I. EMANUEL-IOAN
OPRITA G. SEBASTIAN
OSTOIA A. D. OVIDIU-BOGDAN
PANAITE M. ADRIAN-FLORIN
PINTEA D. SORIN
PLAVITU-LOTOROSANU M. ADRIAN
PLOSCARU G. GABRIEL-MIHAI
POPA V. DANIEL-VIOREL
POPESCU V. NICOLAE-FLORIAN
PREDA D. MARIAN
PUSCAU I. LORENA-IULIA
RADACINA D. M. GHEORGHE-
ALEXANDRU
ROHOZNEANU M. BOGDAN-MIRCEA
ROSCA V. RAUL-VIOREL
SCHNAKOVSZKI N. VLAD-IULIAN
SIMA D. I. ROXANA-IULIA
SIMANDAN V. M. MARIUS-MIHAI
SITARIU M. MIHAIL-FLORENTIN
STANCIU I. IOAN-BOGDAN
SERBAN D. LARISA-NICOLETA
SERBAN V. ALEXANDRU MIHAI
STEFAN S. ADELA
STEFANIGA A. I. SEBASTIAN-AURELIAN
TARBA E. EMILIAN
TAUTZENBERGER E. CAROLINE
TODOR N. MARIAN
TORAC V. PETRICA-IULIAN
TRINCA M. GEORGE-EUGEN
TUDORUT I. PAUL-IULIAN
TUFIS T. ALEXANDRU
TULEA I. VALENTIN-IOAN
UNGUREANU S. STEFAN-AURELIAN
UNTARU E. SANDEL
VANCA G. GHEORGHE-MARIAN
VANCEA I. IOANA-ELENA
VERSIN G. ALBERT-DUMITRU
VLADAIA I. FLORIN-COSMIN
VOINEA R. IONUT MIREL
STANCULETE GH. ANDREI

INFORMATICA ENGLEZA

Avram Laura
Avram Daniel-Emilian
Baron Alvin-Adrian
Cernoiu Theodor-Andrei
Chereches Vlad-Dan
Chisciuc Ioan-Leonardocezay
Ciobanu Mihnea-Ionut (n-am idee cine e)
Cimpanu Alexandru
Cornigeanu Calin-Alexandru
Cotop Simina-Ana
Demeter Istvan
Galbinasu Marius-Lucian
Ghitescu Stefan
Grigorescu Luisa-Georgiana
Ionesi OVidiu-Daniel
Kundrata-pau Christian-Emanuel
Lasso Claudiu-Daniel
Lukacs Andreea-Maria
Mos Roxana
Niculeasa Bogdan-Constantin
Panait-zadic Alexandru (n-am idee cine e)
Pasat Cristian-Viorel (subsemnatul)
Perian Gheorghe-Bogdan
Petrovici Alexandru
Popa Marius-Petru
Seiman Andrei-Octavian
Spataru Florin-Adrian
Stefanoaica Florian-Lucian
Tampanariu Tiberius-Ciprian
Tudoran Mircea-Ionut
Vaduva Mihai (n-am idee cine e)
Varga Andreea
Remus Sica (???)
Vlad Ogarcin