I have a bash script which getting the data by this:$ ./script.sh var1 var2 var3What I want is to have the variables in a text file in the same format like I type in the command line.input.txtvar1 var2 var3And I want somehow to feed this txt to my bash script in the command line, not in the bash script:./script.sh input.txtHow is it possible?Update:Here is my script:#!/bin/bashDOMAINS=( '.com' '.biz' )VALUE=$(<input.txt)INPUT=(`echo $VALUE`)ELEMENTS=${#DOMAINS[@]}while (( $# )); do  for (( i=0;i<$ELEMENTS;i++)); do      whois $1${DOMAINS[${i}]} | grep --perl-regexp --text --null --only-matching --quiet 'Creation Date'    if [ $? -eq 0 ]; then        echo -e $1${DOMAINS[${i}]}\tregistered\t    else        echo -e $1${DOMAINS[${i}]}\tavailable\t    fi  doneshiftdoneAs you can see, I tried to implement in the script also, but I'm not a programmer.The perfect solution would be to remove the used data from input.txt. So if it reads var1 from input.txt, than remove it from there! This can be solved?
How to parse commands from a text file to a bash script in the CLI
bash;shell script
There are various ways to do this. If your script doesn't need to take more than one argument, just use a while loop to read the file. I would also remove some of the needless grep options (you don't need --only--matching when using --quiet, you're never seeing the output; you don't need perl regex since you're not using any of their features and you don't need --text since you're not going to be parsing binary files) and using the shorter option names for brevity. So, a working (and slightly improved) version of your script would be:#!/bin/bashDOMAINS=( '.com' '.biz' )while read input; do    for (( i=0;i<${#DOMAINS[@]};i++)); do    whois $input${DOMAINS[$i]} | grep -q 'Creation Date'    if [ $? -eq 0 ]; then            echo -e $input${DOMAINS[$i]}\tregistered\t    else            echo -e $input${DOMAINS[$i]}\tavailable\t    fi    donedone < $1If you run that on a file containing:googlefoogleYou get:$ foo.sh filegoogle.com  registered  google.biz  available   gaagle.com  registered  gaagle.biz  available   