1752728 Members
5706 Online
108789 Solutions
New Discussion юеВ

Text file modification

 
SOLVED
Go to solution
rmueller58
Valued Contributor

Text file modification

Wanted to check and see if someone has a simple way I can take a files that looks like this:

-n dbname1
-n dbname2
-n dbname3
-n dbname4
-n dbnamen

and make a line that looks like this:
-n dbname1 -n dbname2-n dbname3-n dbname4-n dbnamen


Any suggestions would be appreciated.






4 REPLIES 4
Heironimus
Honored Contributor
Solution

Re: Text file modification

echo $(cat yourfile)
rmueller58
Valued Contributor

Re: Text file modification

Thank you Hermonius.. That did the trick..

Dennis Handly
Acclaimed Contributor

Re: Text file modification

Or better: echo $(< yourfile)
James R. Ferguson
Acclaimed Contributor

Re: Text file modification

Hi Rex:

> Or better: echo $(< yourfile)

"better" = "faster" as documented in the Posix shell ('sh-posix') manpages.

Regards!

...JRF...