Re: [Networker] nsradmin with shell script
2013-06-14 02:43:03
You have to write a little sub that process line by line the
nsradmin output and looks last line's char.
eg
$LINE="";
while (<INOUT>) {
# READ LINE FROM FILE
$new=$_;
# SKIP EMPTY LINE
if ($LINE eq "") {NEXT}
# IF LAST CHAR IS "\"
if (substr($new,length($new)-1,1) eq "\") {
# THEN LINE IS NOT COMPLETE, appending to current line
$LINE=$LINE+ substr($new,0,length($new)-1);
} else {
# ELSE IT IS END OF LINE
$LINE=$LINE+ $new;
print "NEW LINE IS $LINE";
$LINE="";
}
}
________________________________________
De : EMC NetWorker discussion [NETWORKER AT LISTSERV.TEMPLE DOT EDU] de la part
de bangrn [networker-forum AT BACKUPCENTRAL DOT COM]
Envoyé : vendredi 14 juin 2013 04:05
À : NETWORKER AT LISTSERV.TEMPLE DOT EDU
Objet : [Networker] nsradmin with shell script
Hi ,
when I run below command from shell scripting and out put to a file,
(echo :show name;comment";echo "p type:nsrclient;Storage Nodes:xxxxx") |
nsradmin -i - >> /tmp/clientlist
the $less /tmp/clientlist shows below output as an example:
name:xxxxxxx;
client id: \
ca3c9a8a-00000004-4e6e6100-4e6e60ff-00010c00-e28f8f29;
Question:
How would I get below output instead of the above? I need to display client id
in one line by removing the '\'; is this something to increase the display
bufferring in the nsradmin?
name:xxxxxxxx;
client id: ca3c9a8a-00000004-4e6e6100-4e6e60ff-00010c00-e28f8f29; ;
thanks in advance
+----------------------------------------------------------------------
|This was sent by naga.bangaru AT citec.com DOT au via Backup Central.
|Forward SPAM to abuse AT backupcentral DOT com.
+----------------------------------------------------------------------
|
|
|