alanpclarke
Programmer
Hi,
I am having a really annoying problem with a small perl script I am writing. Basically the issue is that I create a string by joining variables together and I can see that it joins successfully as I print out the result
$Var1 = "Disk Size exceeds ";
$Var2 = "95%";
$Alarm = $Var1 . $Var2;
print $Alarm;
--Output--
Disk Size exceeds 95%
Thats works fine but the problem is that I run the following command
`ssh alarmserver "genalm -a 2020 alarm-log -p $Alarm"`;
*Genalm is just alarm logger where you pass error codes and text to
The problem is that when the alarm message appears on the alarmserver the output is the following
Error Code: 2020 Error Text: Size
It seems to chop up the $Alarm variables according to spaces but I no idea why it would pick the second word in the string as if it was reading in the last variable it would be 95%!!
Can anyone help me? I have tired using the join command insttead of the dot joining. I have also tired to use escape chaceters but no joy. I am sure it is a simple problem but I have gotten a bit tunnel visioned..any help would be great!
I am having a really annoying problem with a small perl script I am writing. Basically the issue is that I create a string by joining variables together and I can see that it joins successfully as I print out the result
$Var1 = "Disk Size exceeds ";
$Var2 = "95%";
$Alarm = $Var1 . $Var2;
print $Alarm;
--Output--
Disk Size exceeds 95%
Thats works fine but the problem is that I run the following command
`ssh alarmserver "genalm -a 2020 alarm-log -p $Alarm"`;
*Genalm is just alarm logger where you pass error codes and text to
The problem is that when the alarm message appears on the alarmserver the output is the following
Error Code: 2020 Error Text: Size
It seems to chop up the $Alarm variables according to spaces but I no idea why it would pick the second word in the string as if it was reading in the last variable it would be 95%!!
Can anyone help me? I have tired using the join command insttead of the dot joining. I have also tired to use escape chaceters but no joy. I am sure it is a simple problem but I have gotten a bit tunnel visioned..any help would be great!