2021-01-31

What does `##*/` means in bash `${qidpath##*/}`?

I try to contribute to a Wikimedia opensource project but I don't get what ##*/ means in bash ${qidpath##*/}. Searching on google for ##*/ is chaotic.

/tmp/datasets/raw/* contains a list of folders.

    for qidpath in  /tmp/datasets/raw/*;
    do
      qid=$(echo ${qidpath##*/} | cut -d'-' -f 1)
      if [[ $qid == Q* ]] ; then
        echo "--> Processing ${qid}..."
        /usr/bin/python3.5 /home/www/CommonsDownloadTool/commons_download_tool.py --keep --sparqlurl https://lingualibre.org/bigdata/namespace/wdq/sparql --sparql "SELECT ?file ?filename WHERE { ${query} ?record prop:P4 entity:${qid}. }" --threads 4 --directory  /tmp/datasets/raw/ --output "/tmp/datasets/${qidpath##*/}.zip" --fileformat ogg
      fi
    done


from Recent Questions - Stack Overflow https://ift.tt/2L3U2Qd
https://ift.tt/eA8V8J

No comments:

Post a Comment