I would like to edit my Apple Script file to improve the format of the output in Mac Terminal.
Background to the problem:
I am new to learning C, and my knowledge of bash is rather limited. I have no experience in writing scripts.
When compiling the C language via TextWrangler, I save the following code in a ".c" file:
#include <stdio.h>
int main() {
printf("Hello, World!");
return 0;
}
and I save it in a directory called "C."
In that directory, I saved a script file that can be found here. For your convenience, I've attached the AppleScript file here:
Now, when I go to "compile and run" in the TextWrangler menu bar, the program compiles successfully- but the output view isn't really all that great. Here's what it looks like:
Users-MacBook-Pro:C username$ cd
'/Users/username/Desktop/Self_Learning/C/'; gcc -o output'
hello_world.c';'/Users/username/Desktop/Self_Learning/C/'output
Hello, World!Users-MacBook-Pro:C username$
(For what it's worth, there are no differing font colors in the Terminal; assume all of it is black).
What I'd like to do- and what I hope people here can help me achieve- is change the script so that the following is not visible:
'/Users/username/Desktop/Self_Learning/C/'; gcc -o output'
hello_world.c';'/Users/username/Desktop/Self_Learning/C/'output
and that right after Hello, world!
output, the bash prompt goes to a new line instead of staying on the same line as the output. In other words, I'd like to see something like this:
Users-MacBook-Pro:C #very minimal text here
Hello, World! #output
Users-MacBook-Pro:C username$ #new line
Thank you in advance for anyone who could help shed light on how I can go about doing this. My motivation for this adjustment is when I run a C file with lots of code and output, I'd like to quickly see any debugging errors that the Terminal might output, and not confuse that pertinent information with compiling commands.