Skip to content

Instantly share code, notes, and snippets.

@stephan-buckmaster
Created November 8, 2023 16:25
Show Gist options
  • Save stephan-buckmaster/3899291a903ad510d36cfc43fcc7bd6b to your computer and use it in GitHub Desktop.
Save stephan-buckmaster/3899291a903ad510d36cfc43fcc7bd6b to your computer and use it in GitHub Desktop.
Demo how to setting env variable in shell, execute given commant
#!/usr/local/bin/bash
# Example usage -- compile https://gist.github.com/stephan-buckmaster/fd4662953d48737f7d592eeb772e76f1 under Linux system, obtain a.out
# Run $ compat-demo.sh a.out 'ABC DEF' 123
# a.out will have MY_LINUX_LIB_PATH set as follows
export MY_LINUX_LIB_PATH=/a/b/c/12/34
exec "$@" # Don't know how to do this in csh/tcsh -- allows treating arguments containing spaces as expected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment