Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2417  / 2 Years ago, sat, february 5, 2022, 1:04:48

I want to create a script that insert 20 characters following each line in a text file.



Suppose the file contains the following lines:



text....
text....
text...


I want to obtain:



text....
------(20 symbols)
text....
------(20 symbols)
text...
------(20 symbols)


How to do this?


More From » scripts

 Answers
1
while read line
do
echo "$line"
echo "characters"
done < input > output


Where input is the source file and output is the destination file.



If you want to input and output to be the standard input and output respectively, then replace done < input > output with just done.


[#29143] Sunday, February 6, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
assionortly

Total Points: 423
Total Questions: 121
Total Answers: 115

Location: Chad
Member since Wed, Sep 30, 2020
4 Years ago
;