---
title: "Discussion on \"Write a script that runs a C file through the preprocessor and saves the result into another file\" | Hashnode"
description: "Discussion on \"Write a script that runs a C file through the preprocessor and saves the result into another file\". Introduction to C programming"
url: "https://hashnode.com/posts/script-that-runs-a-c-file-through-the-preprocessor/6299d9bcf53c6623956c6459"
---

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

Discussion

# [Write a script that runs a C file through the preprocessor and saves the result into another file](https://blog.ehoneahobed.com/script-that-runs-a-c-file-through-the-preprocessor?utm_source=hashnode&utm_medium=feed)

Introduction to C programming

Jun 3, 2022 · 6 min read · blog.ehoneahobed.com  
Read the article

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

## 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 11

Markdown supported · ⌘↵ to post

[Judy Muroki](https://hashnode.com/@JMuroki)

[Sep 28, 2023](https://hashnode.com/posts/script-that-runs-a-c-file-through-the-preprocessor/6299d9bcf53c6623956c6459/comment/651578b65d5d746448ea68ce)

Thanks a lot for this excellent write up.

[SUSAN SEWE](https://hashnode.com/@SUE2023)

[Aug 10, 2023](https://hashnode.com/posts/script-that-runs-a-c-file-through-the-preprocessor/6299d9bcf53c6623956c6459/comment/64d56f83f207cb2b50323ad1)

Thanks. It has confirmed the doubts I had. I was very frustrated with this question having deleted repo 3 times if I cannot understand checker. Blessing to you in abundance.

[Ibrahim Abubakar](https://hashnode.com/@Abuibrahimbbg)

[Jul 15, 2023](https://hashnode.com/posts/script-that-runs-a-c-file-through-the-preprocessor/6299d9bcf53c6623956c6459/comment/64b2d6090470cd817f0ded0f)

I can't say much sir. But honestly this is more than an article to me. I also read your inspiring journey sir, I will trace your steps.

[Tshumelo Matshusa](https://hashnode.com/@Tshuma000)

[Jul 13, 2023](https://hashnode.com/posts/script-that-runs-a-c-file-through-the-preprocessor/6299d9bcf53c6623956c6459/comment/64afda7c3910a270b4c98610)

I think it a very helpful article and I look forward to more.

[Grace Wilson](https://hashnode.com/@MissWil)

[Jun 18, 2023](https://hashnode.com/posts/script-that-runs-a-c-file-through-the-preprocessor/6299d9bcf53c6623956c6459/comment/648f4561fd206a0a78d1cbed)

very helpful

[Mariam Hanna](https://hashnode.com/@MariamO)

[Jun 14, 2023](https://hashnode.com/posts/script-that-runs-a-c-file-through-the-preprocessor/6299d9bcf53c6623956c6459/comment/6489e2fc2ec2d2bb12a3bbeb)

Thanks!

[오상고 아꾸레이](https://hashnode.com/@Marvorlo)

[Feb 16, 2023](https://hashnode.com/posts/script-that-runs-a-c-file-through-the-preprocessor/6299d9bcf53c6623956c6459/comment/63ede4d346e2f1644c4f07e9)

Hello thank you for your guidance, i had an idea on how to solve the problem but the most challenging part was using GCC to preprocess and your article helped me get unstuck,

after learning on how gcc can be used in the compilation process am glad that I have a lot to read about gcc and the compilation process thank you.

[Ian Njuguna](https://hashnode.com/@iano10x)

[Oct 1, 2022](https://hashnode.com/posts/script-that-runs-a-c-file-through-the-preprocessor/6299d9bcf53c6623956c6459/comment/6338223efa20fa4bc8e5721b)

Reading this has saved me ~2hrs of searching for an answer because I was at "What options should I use with the GCC compiler to get the preprocessor intermediate file?" Then I googled and bumped into this very instrumental article.

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

[Oct 5, 2022](https://hashnode.com/posts/script-that-runs-a-c-file-through-the-preprocessor/6299d9bcf53c6623956c6459/comment/6338223efa20fa4bc8e5721b#reply-633dbb2612186eae2bef8cee)

Happy to be of help and I am glad you found it when you needed it.

[Shehu Usman](https://hashnode.com/@Jikalle)

[Sep 10, 2022](https://hashnode.com/posts/script-that-runs-a-c-file-through-the-preprocessor/6299d9bcf53c6623956c6459/comment/631cd90e3e8d6f3497ad4001)

Wonderful and educative. Thump-up to the brain behind this explanation.

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

[Oct 5, 2022](https://hashnode.com/posts/script-that-runs-a-c-file-through-the-preprocessor/6299d9bcf53c6623956c6459/comment/631cd90e3e8d6f3497ad4001#reply-633dbadeb7a1dcae0588d865)

Thank you, I am glad that you found it helpful

[David Jeremiah AKHIGBE](https://hashnode.com/@thedavidjeremiah)

[Sep 9, 2022](https://hashnode.com/posts/script-that-runs-a-c-file-through-the-preprocessor/6299d9bcf53c6623956c6459/comment/631b23903e8d6f3497acf877)

Hello sir, I am a part of ALX Cohort 8 on the brink of dropping out because I am not interested in copy and paste. I want to learn Software Engineering as it is why I am here but it wasn't helping. It all seemed too fast-paced.

But thank God, I found your blog sir. I do not only have an answer but I understand. I know why whatever is what it is and its purpose in the terminal

Thank you, sir.

[Ian Njuguna](https://hashnode.com/@iano10x)

[Oct 1, 2022](https://hashnode.com/posts/script-that-runs-a-c-file-through-the-preprocessor/6299d9bcf53c6623956c6459/comment/631b23903e8d6f3497acf877#reply-63382185fa20fa4bc8e57215)

Keep going, Jeremiah.

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

[Oct 5, 2022](https://hashnode.com/posts/script-that-runs-a-c-file-through-the-preprocessor/6299d9bcf53c6623956c6459/comment/631b23903e8d6f3497acf877#reply-633dba5812186eae2bef8cc6)

Happy to hear that. I believe you can make it once you are determined enough and willing to put in the work. All the best

[Philemon Eyram Ocloo](https://hashnode.com/@peocloo)

[Oct 21, 2023](https://hashnode.com/posts/script-that-runs-a-c-file-through-the-preprocessor/6299d9bcf53c6623956c6459/comment/631b23903e8d6f3497acf877#reply-65331d8c0438e54fa2c71e96)

Had the same question and didn't understand till now, you're a life saver. I wont give up.

[Nelson Joseph Mandela](https://hashnode.com/@NelsM)

[Jun 23, 2022](https://hashnode.com/posts/script-that-runs-a-c-file-through-the-preprocessor/6299d9bcf53c6623956c6459/comment/62b42cc192447c9aed5b15fd)

**Quite an inspiring blog,** _I'm also part of ALX SE cohort\_7._ I enjoyed reading about your journey so far and the progress of what you have been learning. Keep up the good work; will be following.

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

[Oct 5, 2022](https://hashnode.com/posts/script-that-runs-a-c-file-through-the-preprocessor/6299d9bcf53c6623956c6459/comment/62b42cc192447c9aed5b15fd#reply-633dba9bb7a1dcae0588d855)

Thanks a lot, boss. I will continue to do my best
