i need a script to delete files that have core in their name ...it might be part of the file name or as a .core extension ...any file that has core as its extension....
i am only able to delete files which just have thier name as core
using this :
find $1 -type f -name "core" -exec rm -f {} \;
i am passing the directory to look for a a command line argument...
no man its not homework!!!!i wanted to learn it ....as it will be useful for my work because i am mainly a windows person...my office has told me to learn linux.....its part of my learning thing!!!
Ok no problem, even i have gone through this. A unix resource, was asked to work on Visual Basic too which i did but still hate it.
Anyways back to your problem.
Basically you need to know what the system path is ( i hope it is declared as an environment variable some where) and then search for the file at that path.
So check for the executable filename at the specified path, if exists delete the core.
if [[ -x $SYSPATH ]]
then
find $1 -type f -name "*core*" -exec rm -f {} \;
fi