Operating System - HP-UX
1832058 Members
3587 Online
110034 Solutions
New Discussion

Insert line in bottom of the file on several server and remain TAB format in the line.

 
SOLVED
Go to solution
Mike_305
Super Advisor

Insert line in bottom of the file on several server and remain TAB format in the line.

Hello,

I am trying to insert line in a system config file and the format of the line with "TAB" is keeping after I am done inserting the line.

ssh $X echo "*xxx @{server name}" >> /dir/file.conf

ssh $X "echo *xxx @{server name} >> /dir/file.conf"

I have try all the ways and no luck.

Thanks for your help in advance.

Regards,

MP
If there is problem then don't think as problem, think as opportunity.
2 REPLIES 2
James R. Ferguson
Acclaimed Contributor
Solution

Re: Insert line in bottom of the file on several server and remain TAB format in the line.

Hi:

I presume that you want to preserve your TABs and the you want to append to the file on the destination server. Thus:

# ssh -n ${X} 'echo "*xxx@{server name}"' '>>' /dir/file.conf

Regards!

...JRF...
Mike_305
Super Advisor

Re: Insert line in bottom of the file on several server and remain TAB format in the line.

Thanks JRF for your help.

Regards,

MP
If there is problem then don't think as problem, think as opportunity.