Move under www to ease rsync

This commit is contained in:
2025-10-29 10:51:15 +01:00
parent 2bb22c7583
commit 30ad62e938
890 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
#!/bin/bash
#-------------------------------------------------------------------------------
# Example 2 for Bash Tips show 18: transforming words in a string, second
# simpler method that depends on the '-v' operator
#-------------------------------------------------------------------------------
#
# What we'll work on and where we'll store the transformed version
#
phrase='Now is the time for all good men to come to the aid of the party'
newphrase=
#
# How to transform words in the phrase
#
declare -A transform=([good]='bad' [men]='people' [aid]='assistance'
[party]='Community')
#
# Go word by word; if an element with the word as a key exists in the
# 'transform' array replace the word by what's there.
#
for word in $phrase; do
if [[ -v transform[$word] ]]; then
word=${transform[$word]}
fi
newphrase+="$word "
done
echo "$newphrase"
exit