Question: bash read remote file to variable and split using function Read remote file to variable and split using function For this assignment, your bash script
Read remote file to variable and split using function For this assignment, your bash script will need to do a few things. 1. connect using curl to download the personfile.txt from ftp://10.60.168.126/pub the user will be anonymous. (sudo apt-get install curl) curl ftp://10.60.168.126/pub/personfile.txt 2. Your script will then need to store the data returned from curl into a variable (x=curl) ...... 3. Once the data is in the variable you can then use a for loop (see documents above) to read the variable line by line 4. Create and use the function to display the line in seperate parts. (meaning show the line with no pipe and a space between them.) 5. Store the age in a variable and calculate the average age again. Hint: The method for working on this project is one step at a time. Get curl working and storing in a variable. Then focus on reading from the variable line by line. Once those steps are complete begin looking at the cut example and command. Turn that cut into a function that can be called inside your loop
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
