Question: 1. The script requires 3 filenames as arguments, e.g., ./script1 file1 file2 file3. Which files are input files and which are output files? 2. Inside
1. The script requires 3 filenames as arguments, e.g., ./script1 file1 file2 file3. Which files are input files and which are output files?
2. Inside the while-loop, why does variable $line have to be enclosed by double quotes?
$cat script1
#!/bin/bash
exec 3<$1
exec 4<$2
exec 5>$3
while read line <&3
do
echo $line >&5
done
while read line <&4
do
echo $line >&5
done
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
