|
|
| Author |
Message |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12642 Location: Muenster, Germany
|
Posted: Tue Nov 11, 2008 4:14 pm Post subject: |
|
|
Are you using any OS commands in your script? May you please post the code?
Reinhard
|
|
| Back to top |
|
 |
deu439356
Joined: 13 Aug 2008 Posts: 45
|
Posted: Tue Nov 11, 2008 4:23 pm Post subject: |
|
|
I am not using any OS commands.
values.txt File contains:
20
5
25
My Script (I am just printing out the first number from the file):
| Code: | #!/usr/bin/perl
$stats = "./values.txt";
my $counter = 0;
my $result = "";
@var = ();
open(STATFILE,"< $stats") or die "Can't open $stats for read:$!\n";
while ($line = <STATFILE>) {
chop $line;
# print "$line\n";
$var[$counter] = $line;
$counter++;
}
close(STATFILE);
print $var[0]; |
| Description: |
|
| Filesize: |
184.47 KB |
| Viewed: |
199 Time(s) |

|
| Description: |
|
| Filesize: |
132.28 KB |
| Viewed: |
200 Time(s) |

|
|
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12642 Location: Muenster, Germany
|
Posted: Wed Nov 12, 2008 3:47 pm Post subject: |
|
|
Please provide the full path the the data file and retry
Reinhard
|
|
| Back to top |
|
 |
deu439356
Joined: 13 Aug 2008 Posts: 45
|
Posted: Wed Nov 12, 2008 3:48 pm Post subject: |
|
|
| My apologies. I do have the full path in there. I had removed it for troubleshooting different possibilities. Currently the full path is present.
|
|
| Back to top |
|
 |
deu439356
Joined: 13 Aug 2008 Posts: 45
|
Posted: Wed Nov 12, 2008 3:52 pm Post subject: |
|
|
I tried putting my script in the unix_users.pl script (since I am graphing that one), but I still get the errors. What is different between my output and the output from the unix_users script? They both return numbers... Here is the unix_users.pl script (this works, mine above doesn't).
| Code: | #!/usr/bin/perl
my $grep_string = $ARGV[0];
chomp $grep_string;
if ($grep_string eq '') {
open(PROCESS, "who | grep -c : |");
}else{
open(PROCESS, "who | grep : | grep -c $grep_string |");
}
$output = <PROCESS>;
close(PROCESS);
chomp($output);
print $output; |
|
|
| Back to top |
|
 |
deu439356
Joined: 13 Aug 2008 Posts: 45
|
Posted: Wed Nov 12, 2008 4:42 pm Post subject: |
|
|
Gandalf,
I miss read your post. I thought you were talking about the path in the Data Input screen to the script. I put the full path in the script that points to my data file and that resolved my issue. Thank you for your time and helping me resolve this!
|
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12642 Location: Muenster, Germany
|
Posted: Wed Nov 12, 2008 5:11 pm Post subject: |
|
|
Ahh, I'm glad. I just tried all stuff and it worked for me.
CU
Reinhard
|
|
| Back to top |
|
 |
|