in reply to Re^3: Unicode issues with emc uemcli
in thread Unicode issues with emc uemcli
Hi Haukex,
All thanks to your clever code, I am finally able to capture the output to text files too!!. Here's the addition to your code.
my $aref_cmd1= ['uemcli','-d',$vnxe_ip,'-u',$username,'-p',$password, +'/sys/general','show','-detail']; my $aref_cmd2 = ['uemcli', '-d', $vnxe_ip, '-u', $username, '-p', $pas +sword, '/env/bat', 'show', '-detail']; my $aref_cmd3 = ['uemcli', '-d', $vnxe_ip, '-u', $username, '-p', $pas +sword, '/env/ps', 'show', '-detail']; run3 $aref_cmd1, undef, \my $out1; run3 $aref_cmd2, undef, \my $out2; run3 $aref_cmd3, undef, \my $out3; use Encode qw/decode/; my $str1 = decode('UTF-16', $out1, Encode::FB_CROAK); print "$str1\n"; my $textfile2 = "textfile2.txt"; open (my $fh2, '+>', $textfile2) or die "Cannot open file.$!"; my $str2 = decode('UTF-16', $out2, Encode::FB_CROAK); print $fh2 $str2;
Here, the cmd1 prints to screen, cmd2 can be output to a file. cmd3 I am yet to work on. Thank you once again..
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Unicode issues with emc uemcli
by haukex (Archbishop) on Sep 08, 2020 at 07:01 UTC | |
by pritesh_ugrankar (Monk) on Sep 08, 2020 at 16:28 UTC | |
by haukex (Archbishop) on Sep 08, 2020 at 16:53 UTC | |
by pritesh_ugrankar (Monk) on Sep 08, 2020 at 18:47 UTC | |
by haukex (Archbishop) on Sep 08, 2020 at 20:29 UTC | |
Re^5: Unicode issues with emc uemcli
by ikegami (Patriarch) on Sep 07, 2020 at 23:12 UTC | |
by haukex (Archbishop) on Sep 08, 2020 at 06:52 UTC |