Why do you need to use a C program for this (you're not using any C++ features here; this is pure C)? Can't you just use
.bashrc or
.profile if you want to run these commands whenever you open a shell/terminal? (…or whatever gets parsed/run whenever you open a terminal on OS X; I've never done anything remotely "technical/geeky" on a Mac, so I wouldn't know for sure.
)
Typically, when you want to run several shell commands in sequence, you use a shell script rather than a C/C++ program.
A suggested replacement:
Code:
#!/bin/bash
say -v zarvox bears beats battlestar galactica
/Users/jarrodcoffin/prog/c/Basic/mine
cd /Users/my_username/School/C++/template/template
…have this called from
.bashrc or
.profile or whatever it is on OS X, or just put the commands in one of those directly (without the shebang line at the top).
I apologize if you already know this and are simply trying to deliberately run shell commands from a C program for practice.