Created
January 14, 2021 17:56
-
-
Save gubatron/0d5ece82d462d96fec19a0a6f1b6d500 to your computer and use it in GitHub Desktop.
sed: create symlinks to all .exe in a folder
This file contains 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
# | |
# Remember: Pattern matching in sed doesn't use $1 for groups, instead it uses \1. | |
# Remember: Gotta escape the group parenthesis | |
# TODO: How to eval the output. This snippet will only output the transformation but not execute it | |
# | xargs didn't work, wrapping $(sed ...) didn't work either. | |
ls -l *.exe | awk '{ print $9 }' | sed "s/\(.*\).exe/ln \-s \1.exe \1/g" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment