I am using sed
within a while loop to remove the trailing blank spaces from a file containing a list of files. The blank spaces are being removed. But I'm getting the message sed:no input files
.
Following is the while loop I am using:
while IFS= read -r line;
do
echo "tester: $line"
sed -i 's/\s*$//' $line ;
done < file_list.txt
file_list.txt
? – Ipor Sircer Nov 28 '17 at 10:46tail -1 file_list.txt
? If you don't see anything except an empty line then you need to delete that empty line. – B Layer Nov 28 '17 at 12:00$line
is empty, your sed command becomessed -i 's/\s*$//' ;
-- with no file. You must quote the variable:sed -i 's/\s*$//' "$line"
– glenn jackman Nov 28 '17 at 13:45