mirror of
https://github.com/tonydamage/nux-env.git
synced 2025-12-11 13:24:28 +01:00
Added linky and uuidify
This commit is contained in:
parent
5dcb3024c4
commit
2bf96feb5e
2 changed files with 60 additions and 0 deletions
12
bin/uuidify
Executable file
12
bin/uuidify
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
for file in "$@"; do
|
||||
name="${file##*/}";
|
||||
if [[ ! "$name" =~ \.[0-9a-fA-F]{32}\. ]]; then
|
||||
prefix="${file%.*}";
|
||||
suffix="${file##*.}";
|
||||
uuid=$(cat /proc/sys/kernel/random/uuid | tr -d "-");
|
||||
echo "$file" uuidifying
|
||||
mv -v "$file" "${prefix}.${uuid}.${suffix}";
|
||||
fi
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue