We have a scenario while executing a shell script on a unix servers, snippet should be able to run the $hostname and then based on that have to fetch the contents (if $hostname=hostname1 then fetch line1 thru line5)
Ex: file.txt
hostname1
line1
line2
line3
line4
line5
hostname2
text1
text2
text3
text4
text5
text6
text7
hostname3
word1
word2
word3
thanks for the help
script on a unix servers
New contributor
Seethalam Sundeep is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.