Subversion Repositories camp_sysinfo_client_3

Rev

Rev 153 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 153 Rev 165
Line 3... Line 3...
3
use strict;  
3
use strict;  
4
 
4
 
5
# modified 20190419 RWR
5
# modified 20190419 RWR
6
# changed cleanup to remove encapsulating quotes
6
# changed cleanup to remove encapsulating quotes
7
 
7
 
-
 
8
# 20200220 RWR v1.4.1
-
 
9
# added trim
-
 
10
 
8
# Description: Library used by modules. Do NOT enable
11
# Description: Library used by modules. Do NOT enable
9
 
12
 
10
 
13
 
11
our $VERSION = '1.4';
14
our $VERSION = '1.4.1';
12
 
15
 
13
# set of libraries to be used by these modules
16
# set of libraries to be used by these modules
14
 
17
 
15
 
18
 
16
# cleanUp - passed a delimiter and a string, does the following (delimiter can be '')
19
# cleanUp - passed a delimiter and a string, does the following (delimiter can be '')
Line 34... Line 37...
34
      $text = $1;
37
      $text = $1;
35
   }
38
   }
36
   return $text;
39
   return $text;
37
}
40
}
38
 
41
 
-
 
42
# remove leading and trailing spaces from string
-
 
43
sub trim {
-
 
44
 my $value = shift;
-
 
45
 $value =~ s/^\s+|\s+$//g if $value;
-
 
46
 return $value;
-
 
47
}
-
 
48
 
39
# checks if a command is valid on this system. If so, returns the full path to it
49
# checks if a command is valid on this system. If so, returns the full path to it
40
# else, returns empty string.
50
# else, returns empty string.
41
sub validCommandOnSystem {
51
sub validCommandOnSystem {
42
   my $command = shift;
52
   my $command = shift;
43
   $command = `which $command 2> /dev/null`;
53
   $command = `which $command 2> /dev/null`;