strimzi-kafka-connectors/docker/rename_files.sh

15 lines
468 B
Bash
Raw Normal View History

#!/bin/bash
PLUGIN_DIR="/opt/kafka/plugins"
for folder in "$PLUGIN_DIR"/*; do
if [ -d "$folder" ]; then
# Remove the specific prefix from the folder name #=remove left expr
new_name="${folder#"$PLUGIN_DIR"/confluentinc-kafka-connect-}"
# Perform the move and handle errors
if mv "$folder" "$PLUGIN_DIR/$new_name"; then
echo "Successfully renamed: $folder to $PLUGIN_DIR/$new_name"
else
echo "Error renaming: $folder"
fi
fi
done