Created
March 24, 2014 08:40
-
-
Save anonymous/9736469 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function get_absolute_path() { | |
pushd .; | |
local TEMP1=$(dirname $2) | |
local TEMP2=$(basename $2) | |
cd $TEMP1 | |
local TEMP1=`pwd` | |
#JMETER=`$( cd "$( dirname "$1" )" && pwd )`; | |
popd | |
eval "$1=$TEMP1/$TEMP2" | |
} | |
foo=../../test.txt | |
get_absolute_path foo $foo | |
echo $foo | |
# foo sollte jetzt absoluten pfad auf test.txt enthalten |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment