Link to home
Start Free TrialLog in
Avatar of WinPE
WinPE

asked on

Bash - Shell Script - Simple script to create and write variables to txt file.

Can someone help me with a simple bash script to create a file 'test.txt' and write variables to it.
Variable1=10.2.4.1
Variable2=10.2.4.2
Variable3=10.2.4.3
Variable4=10.2.4.4
and then write it to the txt file with a : delimited format. It will always be just one line. It would be like this:
10.2.4.1:10.2.4.2:10.2.4.3:10.2.4.4
The last thing it has to do is place carriage returns on the end of each line so its in windows txt format.

I guess this could be done with sed, but not sure how. Thanks for any help.
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of WinPE
WinPE

ASKER

Thanks Guys!