Skip to content

Instantly share code, notes, and snippets.

@VottusCode
Created April 3, 2022 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VottusCode/6c49c235c11cb7a3290a5310b5860745 to your computer and use it in GitHub Desktop.
Save VottusCode/6c49c235c11cb7a3290a5310b5860745 to your computer and use it in GitHub Desktop.
Link binaries one-liner (example on jdk/bin)
@VottusCode
Copy link
Author

based on cwd:

echo all bins that are to be linked:
for a) for bin in bin/*; do echo $bin; done
for b) for bin in *; do echo $bin; done

a) bin is a child directory (eg. cwd is /opt/jdk-17.0.2+8, bin is at /opt/jdk-17.0.2+8/bin/*):
for bin in bin/*; do ln -s "$(pwd)/$bin" "/usr/$bin"; done

b) bin is current directory (eg. cwd is /opt/jdk-17.0.2+8/bin, which contains the binaries):
for bin in *; do ln -s "$(pwd)/bin/$bin" "/usr/bin/$bin"; done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment