You are not logged in.
hey there,
i made a simple bash script for compiling many *.cpp files in one dir.
#! /bin/bash
find . -name "*.cpp" -exec g++ {} -o {}.sh \;
but if an *.sh already exists it shouldn't compile, also it would be nice to have it named program.sh not program.cpp.sh my bash skills are rather limited, think one could help me out folks
cheers,
detto
Offline
i'd do:
for f in *cpp; do g++ "$f" -o `echo "$f" | sed 's/.cpp$//'`.sh; done
Offline
Ummm... compiling those as .sh files is a terrible idea. .sh indicates a shell script
Offline
and I would use a Makefile
Offline
Heyho. just wanted to thank u for your answers!
Offline
Mh, got another one here :< Still didn't find a GOOD sed tutorial with regexp. It's so damn complicated in my eyes.
Well, I figured something out, but it has a error inside
for f in *.jpg ; do mv "$f" `echo "$f" | sed 's! 1280!!'` ; done
When executing it prompts for every *jpg file with "mv: specified target »(10).jpg« is no directory". :?
Last edited by detto (2007-03-15 13:26:52)
Offline
Offline