Shell commands in a macro file

Is it possible to write commands to the terminal while running a macro with:

root -b -q code.C

How to write that in Code.C?

Cheers,
Eric

to just execute a shell command:
system(“ls”)

if you need the output you can use pipes (in unix systems). look at popen and associated functions.

if you want to execute a root command use gROOT->ProcessLine(".x macro.c");