Skip to content

Wiring up a link to run a bash script to launch Python code

Notifications You must be signed in to change notification settings

scottstanfield/whatdir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Toy example demonstrating paths and readlink and linked bash scripts

This is how you symlink a pointer to a bash executable that calls a Python script. It's all about managing paths with GNU readlink.

Only works in Linux. For Mac, you need GNU readlink (install from brew install coreutils) and change script to call greadlink

To test, clone this repo to a tmp folder somewhere like ~/tmp/whatdir. Then:

./install.sh
cd ~
./whatdir
  • ~/whatdir is linked to ~/tmp/whatdir/main.sh
  • main.sh figures out local path and executes main.py
  • main.py arbitrarily imports another python file in current folder

About

Wiring up a link to run a bash script to launch Python code

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published