mirror of
https://github.com/radareorg/radare2.git
synced 2025-01-19 12:22:43 +00:00
do cannonicalize path the right way (tm)
This commit is contained in:
parent
4b55af759c
commit
de3facf3a9
10
env.sh
10
env.sh
@ -1,11 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
function getabsolutepath(){
|
||||
[ -d "$1" ] && { cd "$1"; echo "$(pwd -P)"; } ||
|
||||
{ cd "$(dirname "$1")"; echo "$(pwd -P)/$(basename "$1")"; }
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
"~"*) pfx="$HOME/`cut -c 2- $1`" ; ;;
|
||||
"/"*) pfx="$1" ; ;;
|
||||
*) pfx="$PWD/$1" ; ;;
|
||||
esac
|
||||
pfx=$(getabsolutepath "$1")
|
||||
|
||||
if [ -z "$pfx" ]; then
|
||||
echo "Usage: ./env.sh [destdir|prefix] [program]"
|
||||
|
Loading…
x
Reference in New Issue
Block a user