Blog de Berto

Una Shell en lenguaje C [Intérprete de Comandos].

por el día Oct.03, 2007, bajo Informática, Interesante

Bueno, esto para los futuros informáticos/as y para la gente que está aprendiendo C en general, dejo aquí una práctica que tuve que hacer en la asignatura de Sistemas Operativos de 1º de Ingeniería en Informática. La práctica consiste en crear una Shell o Intérprete de Comandos para linux en C, el enunciado dice así:


Realice un programa que liste los ficheros del directorio en curso y después muestre por pantalla el mensaje FIN DE PROGRAMA.Realice un interprete de comandos reducido. La función básica de este interprete de comandos será pedir un comando o programa, ejecutarlo y volver a pedir otro comando. El programa terminará cuando se teclee el comando FIN.

El ordinograma del programa será:


a) Los comandos o programas se ejecutarán poniendo la ruta absoluta
b) Si el comando o programa no tiene ruta absoluta se supondrá que se encuentra en el directorio
directorio /bin.
c) Si el comando o proceso no se ejecuta correctamente se visualizará el mensaje de error.
d) El interprete de comandos quedará bloqueado hasta que termine el programa .
e) El interprete de comandos tendrá el siguiente prompt :
f) Permitir que ejecute un comando o programa en segundo plano si el programa termina con &.
g) Cualquier otra opción se valorará

Después de todo esto, finalmente mi shell cumple todos los requisitos, y además le añadí una serie de extras como por ejemplo tuberías ( pipes ) , redireccionamiento de entrada y salida… etc.

Aquí tenéis la documentación y el código, espero que os sea de utilidad.

14,628 Comentarios para esta entrada:
  1. Google Advertising

    I used to be able to find good info from your articles.

  2. DalinaPanova1988doB

    at pfizer is

    019f nmero mprasegurais

  3. earn free paytm cash

    earn free paytm cash

    […]The information talked about in the post are a few of the ideal out there […]

  4. Pandora

    ocelkc,A fascinating discussion is definitely worth comment. I do think that you ought to publish more on this topic, it may not be a taboo hhivoavyaw,subject but generally folks don’t talk about such subjects. To the next! All the best!!

  5. DalinaPanova1988doB

    be at is from india

    019f comprar is original

  6. Buster

    Hi, after reading this amazing article i am as well cheerful to share my know-how here with mates.

  7. fairy halloween costume

    For example,a movie’s download link or a book’s ed2k links?.


    red devils tadalafil [url=][/url] tadalafil professional opinioni

  9. Tamera Mazzetti

    Dysport是A型肉毒桿菌素,為英國一所受嚴格監管的藥廠內透過高科技純化程序提煉的蛋白質。 Dysport更獲美國食品及藥物管理局FDA核准用於美容用途,肯定其效果及安全性。其能有效阻隔神經訊息傳達,令肌肉不受神經控制,減退因肌肉而過度收縮引致的面部動態性皺紋及放鬆過度活躍的肌肉,以達到瘦面、瘦小腿效果;亦能抑制汗腺掛汗的神經系統,有效減少汗水分泌,達到止汗​​及減少異味。Dysport 瘦面 溶脂 Dysport注射到咬肌內,抑制神經肌接頭處乙酰膽鹼遞質的傳遞,使咬肌張力變小而達到瘦臉效果。

  10. Osvaldo Kaucher

    Excellent blog here! Also your website loads up very fast! What web host are you using? Can I get your affiliate link to your host? I wish my website loaded up as fast as yours lol

  11. Johnathon Sitsler

    I not to mention my pals were actually analyzing the great thoughts found on your website and then suddenly got an awful suspicion I never expressed respect to you for them. Those ladies became totally stimulated to read through all of them and have in effect extremely been using these things. Many thanks for being indeed thoughtful and also for getting these kinds of superior resources millions of individuals are really eager to know about. Our sincere regret for not expressing appreciation to you earlier.

  12. Shona Jarzombek

    Thank you for your blog. Much obliged.

  13. detox tea

    detox tea

    […]please stop by the web sites we comply with, like this 1, as it represents our picks through the web[…]


    I loved as much as you will receive carried out right here.
    The sketch is tasteful, your authored subject matter stylish.
    nonetheless, you command get bought an impatience over that you wish
    be delivering the following. unwell unquestionably come further formerly again as exactly the same nearly very often inside case you shield this increase.

  15. health news

    I just could not go away your web site before suggesting that I extremely enjoyed the usual information an individual supply for your guests? Is going to be again ceaselessly in order to investigate cross-check new posts

  16. travel agency

    excellent post, very informative. I wonder why the opposite specialists of this sector don’t notice this. You must continue your writing. I am sure, you have a great readers’ base already!

  17. science

    Good write-up, I am normal visitor of one¡¦s site, maintain up the excellent operate, and It is going to be a regular visitor for a lengthy time.

  18. fashion brand shop

    I enjoy you because of every one of your work on this web page. My niece enjoys participating in investigation and it’s really easy to understand why. We hear all of the powerful ways you create valuable tips and tricks on this web blog and therefore cause participation from website visitors on this idea so my simple princess is studying a lot. Take advantage of the remaining portion of the year. You are doing a great job.

  19. cheap viagra

    is taking viagra bad for you [url=]viagra[/url] omeprazole with viagra

  20. LazarevAgap1993doB

    at is best price uk

    5592 comprar is en europa

  21. Greta Madu

    Greate post. Keep writing such kind of info on your site.Im really impressed by your site.Hey there, You have done an excellent job. I’ll definitely digg it and individually suggest to my friends.I’m confident they will be benefited from this site.

  22. Claribel Boatman

    Excellent blog you’ve got here.. It’s hard to find excellent writing like yours nowadays. I really appreciate people like you! Take care!!

  23. Jackie Muehlbach

    I would like toI mustI’d like toI have to thank you for the efforts you haveyou’ve put in writing thispenning this blogwebsitesite. I am hopingI’m hopingI really hope to seeto viewto check out the same high-grade blog postscontent from youby you in the futurelater on as well. In factIn truth, your creative writing abilities has inspiredmotivatedencouraged me to get my ownmy very ownmy own, personal blogwebsitesite now


    Hello! Do you use Twitter? I’d like to follow you if
    that would be ok. I’m definitely enjoying your blog and
    look forward to new updates.

  25. Nick

    I’m not sure where you’re getting your information, but great topic.
    I needs to spend some time learning more or understanding
    more. Thanks for fantastic information I was looking for this information for my mission.


    Very shortly this web site will be famous amid all blog
    visitors, due to it’s fastidious posts

  27. generic cialis online

    [url=]generic cialis[/url]

  28. Carlos Magno Nunes Barcelos

    Link exchange is nothing else except it is simply placing the other person’s webpage link
    on your page at appropriate place and other person will also do same in support
    of you.

Leave a Reply

Buscas algo?

Usa el formulario de búsqueda:

No encuentras lo que buscas? Deja un comentario en un post o contacta conmigo vía email.