args2slice
raw| 1 | #!/bin/sh |
| 2 | |
| 3 | # Public domain notice for all NCBI EDirect scripts is located at: |
| 4 | # https://www.ncbi.nlm.nih.gov/books/NBK179288/#chapter6.Public_Domain_Notice |
| 5 | |
| 6 | # read command-line arguments, create []string slice |
| 7 | |
| 8 | echo "[]string{" |
| 9 | while [ $# -gt 0 ] |
| 10 | do |
| 11 | echo " \"$1\"," |
| 12 | shift |
| 13 | done |
| 14 | echo "}" |