Skip to content

Commit

Permalink
regex
Browse files Browse the repository at this point in the history
  • Loading branch information
ounsworth committed Nov 2, 2024
1 parent c9fd7da commit 7c3c798
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/test_certs_r4_with_bc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ test_ta () {

tafileBasename=$(basename $tafile)

# strip off the friendly name
tafileBasename=$(echo $tafileBasename | egrep -o '[^-]+_ta.der$')

# strip off the file suffix to get the OID name
if [[ $(expr match "$tafileBasename" ".*_ta\.pem$") != 0 ]]; then
oid=${tafileBasename%_ta.pem}
Expand Down
5 changes: 1 addition & 4 deletions src/test_certs_r4_with_oqs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ test_ta () {

# strip off the file suffix to get the OID name
if [[ $(expr match "$tafileBasename" ".*_ta\.der$") != 0 ]]; then
oid=${tafileBasename%_ta.der}

printf "DEBUG: filename: $tafileBasename, OID: $oid\n"

oid=${tafileBasename%_ta.der}
else # It's some other filename
printf "ERROR: file name is not in the expected format: %s\n" $tafileBasename
printf "ERROR: file name is not in the expected format: %s\n" $tafileBasename >> $logfile
Expand Down

0 comments on commit 7c3c798

Please sign in to comment.