Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/qiuzhanghua/abs_exec

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

Last synced: about 18 hours 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
```