An open API service indexing awesome lists of open source software.

https://github.com/qiuzhanghua/abs_exec

Get Execute file's absolute path
https://github.com/qiuzhanghua/abs_exec

Last synced: 4 months ago
JSON representation

Get Execute file's absolute path

Awesome Lists containing this project

README

        

# Absolute Path of Executed File

## Build

```bash
go build
```

## Usage

```bash
#!/bin/bash
pushd `pwd` > /dev/null
cd `dirname $0`
exec_path=$("./abs_exec")
if [ "$?" != "0" ]; then
echo "Can't find executed file path."
exit 1
fi
echo "$exec_path"
popd > /dev/null
```