Skip to content

Commit 912f081

Browse files
committed
fix: check \$1 not PID in copy_concepts_to_versioned_schema
1 parent 4cf9855 commit 912f081

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

mimic-iv/concepts/copy_concepts_to_versioned_schema.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22
# This script copies the concepts in the BigQuery table mimiciv_derived to mimiciv_${VERSION}_derived.
3-
if [ -z "$$1" ]; then
3+
if [ -z "$1" ]; then
44
echo "Usage: $0 <version>"
55
exit 1
66
fi
77
export SOURCE_DATASET=mimiciv_derived
8-
export TARGET_DATASET=mimiciv_$1_derived
8+
export TARGET_DATASET="mimiciv_${1}_derived"
99
export PROJECT_ID=physionet-data
1010

1111
# check if the target dataset exists
@@ -19,11 +19,11 @@ if bq ls --datasets --project_id ${PROJECT_ID} | grep -q ${TARGET_DATASET}; then
1919
if [[ "${TABLE:0:2}" == '--' ]]; then
2020
continue
2121
fi
22-
bq rm -f -q ${PROJECT_ID}:${TARGET_DATASET}.${TABLE}
22+
bq rm -f -q "${PROJECT_ID}:${TARGET_DATASET}.${TABLE}"
2323
done
2424
else
2525
echo "Creating dataset ${PROJECT_ID}:${TARGET_DATASET}"
26-
bq mk --dataset ${PROJECT_ID}:${TARGET_DATASET}
26+
bq mk --dataset "${PROJECT_ID}:${TARGET_DATASET}"
2727
fi
2828

2929
echo "Copying tables from ${SOURCE_DATASET} to ${TARGET_DATASET}."
@@ -33,5 +33,5 @@ do
3333
if [[ "${TABLE:0:2}" == '--' ]]; then
3434
continue
3535
fi
36-
bq cp -f -q ${PROJECT_ID}:${SOURCE_DATASET}.${TABLE} ${PROJECT_ID}:${TARGET_DATASET}.${TABLE}
36+
bq cp -f -q "${PROJECT_ID}:${SOURCE_DATASET}.${TABLE}" "${PROJECT_ID}:${TARGET_DATASET}.${TABLE}"
3737
done

0 commit comments

Comments
 (0)