Return to Snippet

Revision: 9426
at November 5, 2008 16:42 by aresnick


Initial Code
#!/usr/bin/env bash

echo "           \\$0: $0"

_my_name=`basename $0`
if [ "`echo $0 | cut -c1`" = "/" ]; then
  _my_path=`dirname $0`
else
  _my_path=`pwd`/`echo $0 | sed -e s/$_my_name//`
fi

echo "     Filename: $_my_name"
echo "Absolute path: $_my_path"

Initial URL
http://www.jtanium.com/blog/?p=57

Initial Description

                                

Initial Title
get current script name and absolute paths

Initial Tags

                                

Initial Language
Bash