Skip to content

Commit 214773c

Browse files
fix: semgrep unquoted-variable-expansion-in-command
Signed-off-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com>
1 parent 6c2a41e commit 214773c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

samples/bedrock-agent/scripts/load-kb.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,29 @@ if [ $# -ne 3 ]; then
1313
exit 1
1414
fi
1515

16-
S3_URI=$1
17-
KB_ID=$2
18-
DS_ID=$3
16+
S3_URI="$1"
17+
KB_ID="$2"
18+
DS_ID="$3"
1919

2020
BOOKS_LIST=("https://www.gutenberg.org/ebooks/84.txt.utf-8"
2121
"https://www.gutenberg.org/ebooks/1342.txt.utf-8"
2222
"https://www.gutenberg.org/ebooks/2701.txt.utf-8"
2323
"https://www.gutenberg.org/ebooks/1513.txt.utf-8")
2424

2525
# make a temporary directory to download the books
26-
BOOKS_DIR=`mktemp -d -t books.$$`
26+
BOOKS_DIR=$(mktemp -d -t "books.$$")
2727

28-
pushd $BOOKS_DIR
28+
pushd "$BOOKS_DIR"
2929

3030
# download the books
3131
for book in "${BOOKS_LIST[@]}"
3232
do
33-
curl -L -o "$(basename $book).txt" $book
33+
curl -L -o "$(basename $book).txt" "$book"
3434
done
3535

36-
aws s3 sync . $S3_URI
36+
aws s3 sync . "$S3_URI"
3737
popd
38-
rm -rf $BOOKS_DIR
38+
rm -rf "$BOOKS_DIR"
3939

4040
# sync kb
41-
aws bedrock-agent start-ingestion-job --knowledge-base-id $KB_ID --data-source-id $DS_ID
41+
aws bedrock-agent start-ingestion-job --knowledge-base-id "$KB_ID" --data-source-id "$DS_ID"

0 commit comments

Comments
 (0)