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

Using 'OR' and 'AND' in SQL Server -

python - Finding intersection between ellipse and a line -

c++ - NetBeans Remote Development with additional configuration -