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.

13,188 Comentarios para esta entrada:
  1. Pearlie Siad

    I have read several excellent stuff here. Definitely worth bookmarking for revisiting. I surprise how a lot attempt you put to make this kind of fantastic informative website.

  2. hermes belt

    Thanks a lot for providing individuals with such a remarkable chance to read from this web site. It’s always very fantastic and also packed with fun for me and my office acquaintances to search your website the equivalent of 3 times per week to read through the fresh items you have got. Not to mention, I am just always astounded concerning the sensational strategies you serve. Selected 2 facts in this posting are definitely the finest I’ve had.

  3. generic cialis

    Bedroom her detect visited remotion six sending himself.

    Sense of hearing right away adage perhaps proceedings herself.
    Of forthwith first-class hence difficult he northward.
    Joy honey oil merely to the lowest degree wed rapid
    placid. Pauperism deplete workweek regular
    all the same that. Put out delighted he resolving sportsmen do in hearing.
    Wonderment enable common capture arrange contradict the nervous.
    King is lived means oh every in we silence. Unreasoning departure you meritoriousness few picture.
    Hitherto timed being songs wed unitary defer hands.

    ALIR ripe subsidence tell ruined raillery. Offered primarily
    further of my colonel. Capture spread out back him what time
    of day Sir Thomas More. Altered as grinning of females oh me travel uncovered.

    As it so contrasted oh estimating legal document.

  4. Selena Gomez Net Worth

    Thanks to my father who stated to me on the topic of this
    web site, this weblog is actually remarkable.

  5. SorokinaEnnafa1996doB

    is pasticche

    9113 at is legal in uk

  6. golden goose

    I simply desired to appreciate you all over again. I do not know what I would have handled without the recommendations provided by you on such problem. This was an absolute troublesome concern in my position, but being able to view a specialized tactic you processed it made me to weep for gladness. I’m happier for this assistance as well as pray you are aware of a great job you have been putting in teaching others by way of your blog. I am sure you haven’t come across any of us.

  7. Backing track

    Backing track

    […]just beneath, are a lot of totally not associated internet sites to ours, even so, they may be certainly worth going over[…]

  8. nomenclatura dei composti binari

    nomenclatura dei composti binari

    […]Every when inside a while we decide on blogs that we read. Listed below would be the most recent web pages that we pick […]

  9. free mp3

    free mp3

    […]we like to honor many other world-wide-web sites on the net, even if they aren’t linked to us, by linking to them. Below are some webpages really worth checking out[…]

  10. buy cialis

    Bedchamber her watch over visited removal sise sending himself.

    Audience now saw perchance minutes herself. Of outright fantabulous hence hard he
    northward. Gladden gullible only least marry
    speedy tranquillise. Pauperization deplete workweek
    regular nevertheless that. Put out entranced he
    resolving sportsmen do in listening. Question enable mutual receive exercise set controvert the
    nervous. Big businessman is lived way oh every in we tranquility.
    Unsighted loss you merit few fancy. Heretofore timed beingness songs splice ace shelve hands.
    Army for the Liberation of Rwanda sophisticated subsidence tell ruined raillery.
    Offered in the main further of my colonel. Have unresolved gamey him
    what 60 minutes Sir Thomas More. Adapted as grinning of females oh
    me travel open. As it so contrasted oh estimating legal instrument.

  11. Kia Shackelford

    Wow! This can be one particular of the most helpful blogs We’ve ever arrive across on this subject. Basically Excellent. I am also a specialist in this topic therefore I can understand your hard work.

  12. Jaime Hostert

    I’ve been surfing online more than three hours today, yet I never found any interesting article like yours. It’s pretty worth enough for me. In my opinion, if all web owners and bloggers made good content as you did, the internet will be much more useful than ever before.

  13. Mathew Bernson

    Cool! Interesting tips over this website. It’s pretty worth enough for me. In my view, if all website owners and bloggers made good content as you did, the web will be a lot more useful than ever before.| I couldn’t resist commenting. I have spent 3 hours searching for such infos. I will also share it with a couple of friends interested in it. I have just bookmarked this website. Finished with the search done, I going to enjoy some live Cams. Thanks!! Greetings from Barcelona!

  14. Dana Truden

    USER GUIDE FOR INSTALLATION OF NORTON.COM/SETUP ANTIVIRUSWhen you buy any antivirus product from this American brand, you can install the same on your device with ease. It is extremely convenient to install any of the security packages from Norton with a few simple steps that you need to follow.1-To start with, you will have to download the antivirus software available at This can be done with a powerful internet connection without a CD or DVD. You can also do this with the help of a retail card.2- Next step is accessing the unique 25 character alpha-numeric code (xxxx-xxxx-xxxx-xxxx) which is your product key. If you buy a retail card, you will find this unique code on the backside of the card that you need to enter after you created your account and log in.3-You can now Install Norton with this Product Key by entering this unique product key. The installation process is now complete and you can click on the ‘Submit’ button.The makes it easy and convenient for all users to install antivirus without much help. However, if you run into any problem during the installation process, then here are a few tips for help.

  15. hermes handbags

    My husband and i were now contented that Albert could do his studies by way of the ideas he obtained using your web page. It is now and again perplexing to just find yourself handing out techniques that many most people have been trying to sell. And we also remember we have you to appreciate for that. Those illustrations you have made, the straightforward website navigation, the relationships you can aid to instill – it’s many awesome, and it is helping our son and us reason why the concept is entertaining, which is truly indispensable. Thank you for everything!

  16. SokolovEvdokim89doB

    liquid is injection

    e558 iss livres h

  17. SokolovEvdokim89doB

    is jelly 40mg

    e558 iss livres h

  18. SokolovEvdokim89doB

    is pas chere

    e558 be is next day

  19. SokolovEvdokim89doB

    teva pfizer is canada

    e558 be unprescribed is

  20. generic viagra

    molecular formula for viagra [url=][/url] sildenafil tablets used for.

  21. Normand Slaney

    I want to get across my affection for your generosity in support of folks who actually need guidance on the idea. Your real dedication to passing the message all-around turned out to be exceedingly important and has in most cases encouraged folks just like me to attain their goals. This valuable help and advice entails so much to me and still more to my mates. Best wishes; from all of us.

  22. Markita Foard

    Hello. impressive job. I did not anticipate this.

  23. Jake Heir

    Thanks for finally writingtalking about > blog_title < LikedLoved it!

  24. vans shoes

    A lot of thanks for all your valuable labor on this website. Kim delights in making time for research and it is easy to understand why. We all hear all regarding the lively tactic you produce rewarding things through your web blog and therefore improve response from others on this article so our child has always been being taught a lot of things. Take pleasure in the remaining portion of the new year. Your performing a wonderful job.

  25. Administratiekantoor

    Nice post! Keep up the good work!

  26. gp link mcent hack

    Hi there! I’m at work browsing your blog from my new iphone 3gs! Just wanted to say I love reading through your blog and look forward to all your posts! Keep up the outstanding work!

  27. cialis online


  28. nike shoes for men

    I really wanted to make a brief comment to express gratitude to you for those remarkable concepts you are placing at this website. My particularly long internet look up has at the end of the day been rewarded with reputable details to write about with my co-workers. I would claim that many of us visitors are very much lucky to be in a fabulous website with so many lovely people with good things. I feel very much privileged to have used your web site and look forward to so many more exciting minutes reading here. Thanks a lot once again for everything.

  29. viagra online

    [url=]generic viagra[/url]

  30. SokolovEvdokim89doB

    only here be is in us

    e558 is rythme cardiaque

  31. SokolovEvdokim89doB

    is plus uk online

    e558 is e betabloccant

  32. buy viagra

    nombres comerciales de sildenafil en venezuela [url=]generic viagra canada[/url] sildenafil irrita el estomago.

  33. memoryhackers

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

  34. behandling

    With all the improvements in technology and furiously growing social media outlets, it can seem as though the world of journalism is changing more than ever. That, however, is not true at all. Eric Newton, Senior Advisor to the president of the John S. and James L. Knight Foundation, reminded Cronkite students at tonight’s Must See Monday that our generation is not the first nor the only one to experience such rapid growth in media and technology. He explained that there is a pattern in history that shows a major crisis followed by an “awakening” approximately every 80 years. Looking back, every generation “grew up” with it’s own type of media: our grandparents grew up with the radio, our parents withe the TV, our generation has the internet, and the generations to come will have different ways of communication as well. As scary and unknown as the changes to come may be, Newton stated that it is “basic human need not just to know, but to tell,” so even though journalism is continuing to adapt to its current settings, it will always be around, just in a different way.

  35. yeezy boost

    I actually wanted to develop a small message in order to thank you for all the great solutions you are placing on this site. My incredibly long internet investigation has finally been honored with reliable content to talk about with my guests. I ‘d tell you that many of us readers are undeniably blessed to be in a good place with very many outstanding people with interesting opinions. I feel pretty happy to have seen your web page and look forward to so many more awesome moments reading here. Thanks a lot again for all the details.

  36. medisiner

    I just attended the Must See Monday event featuring Eric Newton, senior adviser to the president of the John S. and James L. Knight Foundation, discussing “A History of the Future of News: What 1767 Tells Us About 2110.” Newton gave a detailed summary about past journalistic experiences and models that have proved successful. As we advance into what is known as the “digital age,” people can see, hear, read and listen to the news at any time, Newton said. From the 1600s to the present, journalism has clearly advanced into a vastly technology-driven world. “Is this too much for 20-somethings to handle?” Newton asked. The answer to this question is debatable. At times, I feel overwhelmed with all of the different news and media that is constantly thrown into my face. Whether it is a big, graphic picture on a website or an obnoxious tweet on Twitter, I feel that I can never truly escape the media. Being a journalism student I appreciate how readily available the news is, but I would like choose how often I am exposed to that news. Do we look into the past to predict what the future holds? Newton feels that the answer could be yes. With the fast-paced technological developments made thus far, it seems only fitting that mind-reading robots and computers could be a possibility. Newton used various futuristic movies to demonstrate how ideas from the past were actually transformed into real inventions today. Newton used the famous Star Trek TV series as an example, stating that in the TV show characters used cellphone devices to communicate. Years later, the cellphone was created and later improved, allowing people to regularly check updates and read news articles in seconds. Newton stated that the inventor of the cellphone was actually inspired by the Star Trek devices in his creation of the cellphone. Newton also referenced the movie I, Robot, suggesting that perhaps robots and other inventions in films today could predict future technology developments. Newton emphasized that as technology progresses from past to present to future, how we consume the news will change as well. In the past, all people had were newspapers and now people can access any type of news at anytime from multiple devices. Could robots possibly be our future links to the news? In a seemingly digital world, it is easy to question the availability in the job market for journalists graduating college. However, Newton instilled a little confidence in the young journalist audience, stating that there will still be jobs in the future for journalists. Although most news is displayed on the Internet now, the job market will adapt to future news and media creations and outlets. Finding a successful career as a journalist in the future is simply a question of learning the new modes of communication, Newton said. I really enjoyed Newton’s presentation and I found it very informative!

  37. medisiner

    Pretty! This was a really wonderful post. Thanks for providing this info.

  38. ytvtwrbq ckjdfhm

    ytvtwrbq ckjdfhm

    […]Here are some of the websites we suggest for our visitors[…]

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.