As the question implies I am intending to store the input through a bash script in raw format using a single variable.
Basically when the input prompt occurs, I would be pasting some bunch of lines and then writing that stored variable to a text file. After a bit of search I did came across readarray but it is not storing the input/paste in its original paste state
Just for the purpose of simplicity lets say the input/paste I am intending to store in the variable is as follows:
1
2
3
4
5
Expected script
#!/bin/bash
#the part i need help with ( Store the multiple line input/paste in raw format in a variable called let say test )
....
echo "$test" > test.txt
cat test.txt
This should print that 1..5 exactly in the format I have pasted during input prompt in console / also shown above
Edit - It might be possible someone is curious what is my actual use case, so I am giving an example what my paste actually is in real use case. I used 1..5 example in question only for simplicity.
https://cdn.jwplayer.com/videos/XXXizsW4-32313922.mp4
out=Lecture 01- AS 1 Theory.mp4
https://cdn.jwplayer.com/videos/XXX6XFPB-32313922.mp4
out=Lecture 02- AS 1 Question.mp4
https://cdn.jwplayer.com/videos/XXXIeQNM-32313922.mp4
out=Lecture 03- AS 2 Theory.mp4
I would be pasting text in such format only
https://link
out=Some-Name.mp4 ( 2 spaces before word out )
Although there are 300,400 such pairs of lines that I would be pasting (if that matters).