Anything goes
random and perhaps useful information
Tuesday, June 21, 2011
How to determine if a file is in your shell search path
If you ever had the need to determine if a file is in your search path, the following Bash function does the job.
is_in_search_path ()
{
file="$1"
if ! type "$file" >/dev/null 2>&1; then
return 1
fi
return 0
}
No comments:
Post a Comment
Newer Post
Older Post
Home
View mobile version
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment