hello you can use a simple command basename to extract the string after the last occurrance /
path=/blah/blah/blah/file
filename=$(basename path)
echo filename
Hi all,
Here is my situation.
I have a text file TXT_FILE like this:
john 123456
jack 94589
kelvin 94595
mary 88585
I want to read the first word in each line ( the name ) and assign to a string variable ( EX_LIST ) in my script so that I can use later as this commandfor i in... (6 Replies)
i am new user of unix.i have a question.My script is-
export STR_ALFA=`head -2 "${FILE_PATH}"|tail -1|cut -d"," -f1`
"${TEST_HOME}"/function/chk_alfa.ksh STR_ALFA
now i want to check STR_ALFA:
1)whether is alphabetic
2)whether is numeric
3)whether is alphanumeric... (1 Reply)
i am new user of unix.i have a question.My script is-
export STR_ALFA=`head -2 "${FILE_PATH}"|tail -1|cut -d"," -f1`
"${TEST_HOME}"/function/chk_alfa.ksh STR_ALFA
now i want to check STR_ALFA:
1)whether is alphabetic
2)whether is numeric
3)whether is alphanumeric... (1 Reply)
Hi,
I wish to find all lines that contain a specific search word, and then do few string operations on that line. The idea is to "fix" the file which has been moved from windows to unix.
Using unix - Sun Solaris
Test input ("t2.sas")
statement1
statement2
libname yahoo ... (6 Replies)
Hello,
I'm trying to get the configuration-IP-Addresses from Cisco-configurations
on the Routers they are defined as a Loopback0-interface like this:
interface Loopback0
ip address 172.23.19.249 255.255.255.255
On the Switches they are defined as a VLAN 80 interface like this
... (4 Replies)
I have a txt file with several columns and i want to peform an operation on two columns and output it to a new txt file .
file.txt
900.00000 1 1 1
500.00000
500.00000
100000.000
4
4
1.45257346E-07 899.10834 ... (4 Replies)
I have a file that contains RewriteRules for 200 countries (2 examples for 1 country below):
RewriteRule ^/at(/|/index.html|)$ http://%{HTTP_HOST}/locate/index.html?locale=de_AT
#&
RewriteRule ^/at_english(/|/index.html|)$ http://%{HTTP_HOST}/locate/index.html?locale=en_AT
I have... (5 Replies)
Hi, to everybody
i have a string which Looks like this
FT47;3;1;1;;;1;09.02.2017 21:21:19;2;2
and i would like to change to value on one Position only
e.g. the values on Position 6 should change to 1 nevertheyless which values was there before
AIX 4.3.2.0 and csh
i try... (10 Replies)
Hi to everybody
i stuck on a simple thing i had a string and i want cut it , i try already few thing with the cut command but does not the way it should.
The script is in csh and running on AIX 4.3.2.0
here are few samples how the string can look like
FT71;1;1;1;;;1;31.01.2017... (9 Replies)
Discussion started by: Nadielosabra
9 Replies
LEARN ABOUT CENTOS
mail::spamassassin::util
Mail::SpamAssassin::Util(3) User Contributed Perl Documentation Mail::SpamAssassin::Util(3)NAME
Mail::SpamAssassin::Util - utility functions
DESCRIPTION
A general class for utility functions. Please use this for functions that stand alone, without requiring a $self object, Portability
functions especially.
NOTE: The functions in this module are to be considered private. Their API may change at any point, and it's expected that they'll only be
used by other Mail::SpamAssassin modules. (TODO: we should probably revisit this if it's useful for plugin development.)
NOTE: Utility functions should not be changing global variables such as $_, $1, $2, ... $/, etc. unless explicitly documented. If these
variables are in use by these functions, they should be localized.
$module = first_available_module (@module_list)
Return the name of the first module that can be successfully loaded with "require" from the list. Returns "undef" if none are
available.
This is used instead of "AnyDBM_File" as follows:
my $module = Mail::SpamAssassin::Util::first_available_module
(qw(DB_File GDBM_File NDBM_File SDBM_File));
tie %hash, $module, $path, [... args];
Note that "SDBM_File" is guaranteed to be present, since it comes with Perl.
my ($filepath, $filehandle) = secure_tmpfile();
Generates a filename for a temporary file, opens it exclusively and securely, and returns a filehandle to the open file (opened
O_RDWR).
If it cannot open a file after 20 tries, it returns "undef".
my ($dirpath) = secure_tmpdir();
Generates a directory for temporary files. Creates it securely and returns the path to the directory.
If it cannot create a directory after 20 tries, it returns "undef".
perl v5.16.3 2011-06-06 Mail::SpamAssassin::Util(3)