Ecosyste.ms: Awesome
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: about 18 hours ago
JSON representation
Get Execute file's absolute path
- Host: GitHub
- URL: https://github.com/qiuzhanghua/abs_exec
- Owner: qiuzhanghua
- License: mit
- Created: 2021-07-11T09:46:44.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-06T07:03:35.000Z (almost 3 years ago)
- Last Synced: 2024-06-20T23:33:27.538Z (5 months ago)
- Language: Go
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
```