I'm playing around with the accepted answer from this thread:Bash script that reads filenames from a pipe or from command line args?When I use the below script, efetch (ftp://ftp.ncbi.nlm.nih.gov/entrez/entrezdirect/edirect.zip) accepts an id (argument, for example, 941241313) but not stdin.if [ $# -gt 0 ] ;then    for name in $@; do        efetch -db nucleotide -id $name -format gpc > $name.xml;    done  else    IFS=$'\n' read -d '' -r -a filenames    while read name; do        efetch -db nucleotide -id $name -format gpc > $name.xml;    done < ${filenames[@]}  fiWhen I modify it to the below version, efetch accepts stdin instead of an idif [ $# -gt 0 ] ;then    while read name; do        efetch -db nucleotide -id $name -format gpc > $name.xml;    done < $@  else    IFS=$'\n' read -d '' -r -a filenames    while read name; do        efetch -db nucleotide -id $name -format gpc > $name.xml;    done < ${filenames[@]}  fiWhat's wrong?
While loop for bash scripting to read either stdin or arguments
bash;arguments;stdin