Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-20-2015, 05:01 PM   #1
Registered: Jul 2009
Posts: 619

Rep: Reputation: 42
Script Issue

I have written the following script to read value(Name) in a XML file and then based on that change the password.It works but I get this error sometime on execution :

Here is a snippet of the file I am traversing is

<Node Name="MUN" Type="Connection" Descr="" Icon="mRemoteNG" Panel="General" Username="root" Domain="" Password="a/5pqLSsMnvRfylxdN6coiFTdc2+$
<Node Name="ubunugit" Type="Connection" Descr="" Icon="mRemoteNG" Panel="General" Username="root" Domain="" Password="bBxKPKXIhw1wKEV9aEUN1yynoRGOWT$
</Connections> <---- this is line 217, dont know why it is failing on this
Use of uninitialized value in concatenation (.) or string at line 27, <XML> line 217


use strict;
use warnings;

my ($found, $pass, $name, $line, @array, @sarray, @files, @names, @password);

open(XML, "/home/stain/Downloads/REMOTEopen.xml") || die ("Error: $!");



@sarray=split(" ", $_);

@names = grep /\bName=/, @sarray;
@password = grep /\bPassword=/ , @sarray;

foreach( @names, @password)

print ("Enter the plain text password for $_, password is currently $password[0]\n");
print qq(You will now swap $password[0] for Password="$pass"\n);
print "continue? y/n\n";
my $ans=<>;
if ($ans =~/y/im)

can I get some assistance here, or even a better way to approach this, I even looked at hashes.

Thank you
Old 11-20-2015, 07:26 PM   #2
Senior Member
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,626

Rep: Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529Reputation: 1529
I wonder whether your error is related to the Password strings not being enclosed in double quotes.
Old 11-21-2015, 05:01 AM   #3
Registered: Jul 2009
Posts: 619

Original Poster
Rep: Reputation: 42
Thanks, No, I tried that it doesnt work
Old 11-23-2015, 06:02 PM   #4
Registered: Nov 2015
Location: Houston, Texas, US
Distribution: RHEL/CentOS, Debian/Linux Mint, SLES
Posts: 40

Rep: Reputation: 19
You have two places where you have opening double quotes, but no closing double quotes:
Password="a/5pqLSsMnvRfylxdN6coiFTdc2+$ ... Password="bBxKPKXIhw1wKEV9aEUN1yynoRGOWT$


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] shell script issue how to pass the license exceptance as yes through script rohaanembedded Programming 5 07-03-2013 01:46 AM
Issue in running commands in expect script from shell script yadvinder Programming 0 05-31-2012 04:07 AM
Issue with Script?? linuxshadow Linux - Newbie 1 06-11-2008 01:28 AM
sh script issue. UltraSoul Solaris / OpenSolaris 4 03-29-2007 04:31 PM
Script Issue gauge73 Linux - General 8 07-14-2003 08:50 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:40 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration