Add existing scripts
This commit is contained in:
1 parent
2ab5a42c2b
commit
3c05d74104
31 files changed
+1138
No files matched your search
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
# When files or symlinks may include a space in the name,
|
||||
# this style of looping over them can come in handy.
|
||||
#
|
||||
# Save the current value of IFS, so you can restore it later. Split on newlines.
|
||||
old_ifs=$IFS
|
||||
IFS=$'\n'
|
||||
|
||||
# Find all symlinks and print each one
|
||||
links=$(find ~ -type l -maxdepth 1)
|
||||
|
||||
for link in $links
|
||||
do
|
||||
echo "Found Link: $link"
|
||||
done
|
||||
|
||||
# Restore the original IFS value
|
||||
IFS=$old_ifs
|
||||
|
||||
# While this can be used to cover a specific edge case, if you change the IFS
|
||||
# variable often, that is a sign that a programming or other scripting language
|
||||
# would provide a better solution
|
||||
Reference in new issue
Block a user