[DiscordArchive] or is it...?
[DiscordArchive] or is it...?
Archived author: AlexanderESmith • Posted: 2023-08-30T14:38:41.028000+00:00
Original source
hahahaha
Archived author: mynameismeat • Posted: 2023-08-30T14:39:03.147000+00:00
Original source
seems legit though, other than the prefix
Archived author: AlexanderESmith • Posted: 2023-08-30T14:39:10.975000+00:00
Original source
I was doing it that way so I could move the rules around, but your method preserves that ability
Archived author: AlexanderESmith • Posted: 2023-08-30T14:39:15.521000+00:00
Original source
Oh, fuck
Archived author: AlexanderESmith • Posted: 2023-08-30T14:39:23.727000+00:00
Original source
I guess I stripped that out at some point X
Archived author: AlexanderESmith • Posted: 2023-08-30T14:39:26.383000+00:00
Original source
xD
Archived author: AlexanderESmith • Posted: 2023-08-30T14:39:28.162000+00:00
Original source
It WAS there
Archived author: AlexanderESmith • Posted: 2023-08-30T14:39:52.530000+00:00
Original source
message.txt
Archived author: AlexanderESmith • Posted: 2023-08-30T14:41:02.856000+00:00
Original source
Optimally this would take 2 inputs; The `.conf` and the `.conf.dist` file. It would run a diff to get only the needed lines, run the conversion, and display the converted lines.
Archived author: AlexanderESmith • Posted: 2023-08-30T14:55:15.750000+00:00
Original source
```CONF=$1
DIST=$2
CHANGES=$(diff -s --suppress-common-lines $CONF $DIST | grep -v '>' | head -n-1 | tail -n+2 | sed 's/^< //g')
echo "$CHANGES" | grep -Ev '^$|^#|^\['
echo
IFS=$'\n'
for LINE in $(echo "$CHANGES" | grep -Ev '^$|^#|^\[')
do
# Store the var name and it's value into 2 vars;
VARNAME=$(echo $LINE | awk -F'=' '{print $1}' | sed 's/ //g')
VALUE=$(echo $LINE | awk -F'=' '{print $2}' | sed 's/ //g')
# Convert the variable name
VARNAME_CONVERTED=$(echo $VARNAME | awk '{print $1}' | sed \
-e 's/\([A-Z]\)/ \1/g' \
-e 's/^ //g' \
-e 's/ /_/g' \
-e 's/\./_/g' \
-e 's/__/_/g' \
-e 's/[a-z]/\U&/g' \
-e 's/X_P/XP/g' \
-e 's/G_M/GM/g')
# Echo the new format
echo "AC_${VARNAME_CONVERTED}: \"${VALUE}\""
done```