C++ running command in linux terminal I dont get it

view story

http://stackoverflow.com – I'm teaching myself C++ let's get that on the table. I learn best by choosing what I want to program and just doing it, the step by step hello world and so on tuts are to slow for me so that aside now. I am trying to figure out how to run a string I got through getline (cin,str) in terminal (Kubuntu). I read through system() that sounded like a bad option, fork() I dont get fully, and exec() either. Maybe I'm thinking of this wrong. Basically I would like to move a bash script I wrote and make it a program. I'm pretty sure it's not a small task but I'm doing this for fun. Any help is welcome (HowTos)