Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save DrAzraelTod/9736525 to your computer and use it in GitHub Desktop.
Save DrAzraelTod/9736525 to your computer and use it in GitHub Desktop.
#!/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