exe=`basename $1 .c`
gcc $1 -o $exe
Will compile source.c and the output file will be source.
I use it along with a bash alias.
Here is mine:
this script is used to change all the permissions on a directory tree: it is possible to set different permissions for regular files and folders. So for example I use it for my "Music" folder:
./permfix.sh -f 640 -d 750 $HOME/Music
in this way I have the right permissions for the files and folders (the latter need a +x for "browse permission").
There is also a "pretend mode" in which the scripts just prints what it would have done in "standard mode" without actually touching any file.
Use it at your own risk. :)
filenames="file1 file2 file3 file4 file5 file6 file7"
target="everything" # target filename for full ZIP archive + .zip
searchdb="search-database" # target filename for search db ZIP archive
newestfile="$(ls -t *xml | head -1)"
if [ $newestfile -nt $target.zip ] ; then
# time to rebuild the archive
zip $target *xml