Re: [Networker] Formating of nsradmin output
2004-08-05 21:46:49
I have multiple entries. I am trying to build a text file to use with
nsradmin to create groups, clients and schedules.
e.g.
nsradmin -i <filename> -s <server_name>
Thanks
Somen
-----Original Message-----
From: Darren Dunham [mailto:ddunham AT TAOS DOT COM]
Sent: Thursday, August 05, 2004 2:46 PM
To: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
Subject: Re: [Networker] Formating of nsradmin output
>
> Can anyone help me reformat this following output:
>
> type: NSR group;
> name: 0300W;
> comment: ;
> snapshot: False;
> autostart: Enabled;
> start time: "1:50";
> interval: "24:00";
> client retries: 1;
> clones: No;
> clone pool: Default Clone;
> migration clone pool: Migration Clone;
> printer: ;
> Snapshot Policy: Daily;
> Snapshot Pool: Default;
>
> Such that it reads as follows:
>
> type: NSR group; name: 0300W; comment: ; snapshot: False;
>
> I mean to put them in a contiguous line instead of every parameter
reading
> in a separate line.
Do you only have one entry, or do you have multiple ones?
If you only have one, this is trivial..
perl -e 's/\n//; END { print "\n"; }' /your/file/here
If you can't stand the extra whitespace on the line...
perl -e 's/\n/ /; s/^\s*//; END { print "\n"; }' /your/file/here
sed/awk/tr solutions also possible, but I'm usually using perl when I'm
reformatting all sorts of networker output.
Can I ask if you're reformatting to feed back to networker, or into
something else?
--
Darren Dunham ddunham AT taos DOT com
Senior Technical Consultant TAOS http://www.taos.com/
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >
--
Note: To sign off this list, send a "signoff networker" command via
email
to listserv AT listmail.temple DOT edu or visit the list's Web site at
http://listmail.temple.edu/archives/networker.html where you can
also view and post messages to the list.
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
--
Note: To sign off this list, send a "signoff networker" command via email
to listserv AT listmail.temple DOT edu or visit the list's Web site at
http://listmail.temple.edu/archives/networker.html where you can
also view and post messages to the list.
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
|
|
|