bash - Include a file to an executable script, grab line 1 and line 2, assign them to data_holders -


assume there file named a.txt
contains:

aaa bbb 

i need create executable script that
grab these 2 lines a.txt

and print them in terminal.

in other words when run..

./script 

it needs print

aaa:bbb 

update

i need assign first line file a.txt
letter "a"

i need assign second line file a.txt
letter "b"

so can access "a" , "b" within bash script
separately.

you can use awk this:

awk '{printf $1":"}' a.txt 

Comments

Popular posts from this blog

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -