Created
April 3, 2022 10:40
-
-
Save VottusCode/6c49c235c11cb7a3290a5310b5860745 to your computer and use it in GitHub Desktop.
Link binaries one-liner (example on jdk/bin)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for bin in *; do ln -s "/opt/jdk-17.0.2+8/bin/$bin" "/usr/bin/$bin"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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