Advertisement
Guest User

Compile & run c

a guest
Feb 6th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. filename=$(echo $1| cut -d '.' -f 1)
  4. commandi="gcc $1 -o $filename"
  5.  
  6. eval $commandi
  7. if [[ $2 == 1 ]]; then
  8.     eval "./$filename"
  9. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement