---
title: "Discussion on \"Building a simple shell in C - Part 4\" | Hashnode"
description: "Discussion on \"Building a simple shell in C - Part 4\". Getting the path for each command typed on our shell"
url: "https://hashnode.com/posts/building-a-simple-shell-in-c-part-4/6374768e5d21d5e9dbd004a2"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Building a simple shell in C - Part 4](https://blog.ehoneahobed.com/building-a-simple-shell-in-c-part-4?utm_source=hashnode&utm_medium=feed)

Getting the path for each command typed on our shell

Nov 16, 2022 · 12 min read · blog.ehoneahobed.com  
Read the article

-   [#bash](https://hashnode.com/tag/bash)
-   [#shell](https://hashnode.com/tag/shell)
-   [#c](https://hashnode.com/tag/c)
-   [#c-programming](https://hashnode.com/tag/c-programming)
-   [#alx](https://hashnode.com/tag/alx)

## Written by

[Dr. Ehoneah Obed](https://hashnode.com/@ehoneahobed)

@ehoneahobed

  
[View profile](https://hashnode.com/@ehoneahobed)

Software and AI engineer, health informatician, and registered pharmacist. I write about what I build and what I learn.

Heya! 👋 I love helping people, and one of the best ways I do this is by sharing what I learn and build. I started as a pharmacist at a tertiary hospital in Northern Ghana, where I saw how much technology could improve healthcare. That sparked my interest in digital health. I taught myself to code, then joined the ALX Software Engineering program, which became a turning point. I went on to complete a Master of Health Informatics at the University of Toronto. Today I am a software and AI engineer and a health informatician, and I practise remotely as a Digital Health Pharmacist. I combine clinical experience with technical skills to build tools that solve real problems in health and beyond, and I write here about what I build and what I learn.

## Responses 8

Markdown supported · ⌘↵ to post

[Naol Solomon](https://hashnode.com/@NaolSolomon)

[Sep 15, 2023](https://hashnode.com/posts/building-a-simple-shell-in-c-part-4/6374768e5d21d5e9dbd004a2/comment/6503b181770802e8a4add026)

it is really amazing

[Adegbite Seyi](https://hashnode.com/@Adegbite0382)

[Sep 8, 2023](https://hashnode.com/posts/building-a-simple-shell-in-c-part-4/6374768e5d21d5e9dbd004a2/comment/64fa94b1c035cd988c325e0c)

is this the last part of the series Dr.

[Julius Ibe](https://hashnode.com/@juliusIbe)

[Jul 20, 2023](https://hashnode.com/posts/building-a-simple-shell-in-c-part-4/6374768e5d21d5e9dbd004a2/comment/64b939b9af9957de87410c3a)

Hello Dr. Ehoneah, I enjoyed this simple shell series a lot. It is very informative and quite educating too. Could you write part 5 soon? We appreciate all you do. Thanks and God bless!

[Ahmed olalekan](https://hashnode.com/@Olalekan1)

[Apr 1, 2023](https://hashnode.com/posts/building-a-simple-shell-in-c-part-4/6374768e5d21d5e9dbd004a2/comment/6427fbd4318b4dd1473116b1)

Thank you very much for all this your effort, all i could say is GOD BLESS YOU.

but we are eagarly waiting for the next part.

Also, i will like to seek from you... i hope my wish is granted... i would like to always come to meet you for insight?

Thank you sir.

[michael yin](https://hashnode.com/@MicYn)

[Mar 19, 2023](https://hashnode.com/posts/building-a-simple-shell-in-c-part-4/6374768e5d21d5e9dbd004a2/comment/64170e9f4e399cd51f92fa01)

I want to see the part five of this project so badly... This really helps A LOT.

[paul olalekan](https://hashnode.com/@Proffcodes)

[Nov 18, 2022](https://hashnode.com/posts/building-a-simple-shell-in-c-part-4/6374768e5d21d5e9dbd004a2/comment/63774b80de61278337f14f65)

It's very good and educative

[Dr. Ehoneah Obed](https://hashnode.com/@ehoneahobed)

[Nov 19, 2022](https://hashnode.com/posts/building-a-simple-shell-in-c-part-4/6374768e5d21d5e9dbd004a2/comment/63774b80de61278337f14f65#reply-637945c550bf0b984744f09e)

Happy to hear and thanks for the feedback. I really appreciate it.

[paul olalekan](https://hashnode.com/@Proffcodes)

[Nov 18, 2022](https://hashnode.com/posts/building-a-simple-shell-in-c-part-4/6374768e5d21d5e9dbd004a2/comment/637746c22859b88312dda0b8)

Thanks for your efforts in making us a better software engineer. Please sir I will like you to please finish the creating the shell project because I am really learning from you. God bless you 🙏

[Dr. Ehoneah Obed](https://hashnode.com/@ehoneahobed)

[Nov 19, 2022](https://hashnode.com/posts/building-a-simple-shell-in-c-part-4/6374768e5d21d5e9dbd004a2/comment/637746c22859b88312dda0b8#reply-637945acb1e7ce9589454231)

You are welcome. I will do my best to.

[rotimi omitogun](https://hashnode.com/@Rotimi1)

[Apr 14, 2023](https://hashnode.com/posts/building-a-simple-shell-in-c-part-4/6374768e5d21d5e9dbd004a2/comment/637746c22859b88312dda0b8#reply-6438f015ed370ca55135d1b3)

[Dr. Ehoneah Obed](https://hashnode.com/@ehoneahobed) is the last parts out yet? Please we need it. Very informative. Is it possible to do for printf sir?

[Olanrewaju Olamide](https://hashnode.com/@Olyray)

[Nov 17, 2022](https://hashnode.com/posts/building-a-simple-shell-in-c-part-4/6374768e5d21d5e9dbd004a2/comment/6376643adc823473f485b65f)

Didn't occur to me that I could use the stat function to check if a file directory is valid.

[Dr. Ehoneah Obed](https://hashnode.com/@ehoneahobed)

[Nov 19, 2022](https://hashnode.com/posts/building-a-simple-shell-in-c-part-4/6374768e5d21d5e9dbd004a2/comment/6376643adc823473f485b65f#reply-6379458db1e7ce958945422b)

Now you know better. Try it out and see
