Hello everyone!
I am having some trouble with a bash script. basically what I am trying to do is loop through a file (input.list) line by line and have it run a curl command against a website. I have it doing that right now, and it is outputting the data I want it to, but i also want it to display what is in the orinal file in the first column. I've listed some examples below.
Key
- script.sh : the script i am working on
- input.list : the input file
- output.list : the file i want it to output to
script.sh
Code:
#!/bin/bash
while read line; do
echo "second column"
done < "input-test.list" > "output-test.list"
input.list
Output I am getting
Code:
second column
second column
second column
second column
Output I want to go into output.list
Code:
A: second column
B: second column
C: second column
D: second column
NOTE: I replaced the curl command with a quick 'echo' command for simplicity. but the 'second column' will be a random value that is parsed from the actual curl command that will be given.
If anyone could help me out that would be great! Thanks in advance!