I have a variable dynamically generated
$batch = /dataload/R3P/interface/Bowne/reports/RDI00244.rpt
Now I'd like to strip '/dataload/R3P/interface/Bowne/reports/RDI' and '.rpt' from this variable
my output should be only 00244
how to do this using perl regex.I'm a newbie to perl and would... (1 Reply)
I'm working on a basic log parser in perl. Input file looks like:
len: 120713
foo
bar
file size of: testdir1/testdir1/testdir1/testdir1/testfile0 is 120713Of course there are tens of thousands of lines... I'm trying to compare the len and filesize values.
#!/usr/bin/perl
use strict;
use... (2 Replies)
Hi,
I have a string like
"something is good wanted (bla bla)"
I need to get the world "wanted" from this string and "assign it to a variable".. but it's not a static word so i want to get that word by searching the pattern as follows
<space>desiredword<space>(
and i tried to get that... (6 Replies)
hello mighty all
there's a file with lots of comments.. some of them looks like:
=comment
blabla
blablabla
bla
=cut
i'm trying to cut this out completely with this code:
$line=~s/^=.+?=cut//sg;
but no luck
also tryed to change it abit but still I don't understand how the... (9 Replies)
Hi,
I've a logfile which i need to parse and get the logs depending upon the user input. here, i'm providing an option to enter the string which can be matched with the log entries.
e.g. one of the logfile entry reads like this -
$str = " mpgw(BLUESOAPFramework):... (6 Replies)
Hello, ksh on Sun5.8 here. I have a pipe-delimited, variable length record file with sub-segments identified with a tilda that we receive from a source outside of our control. The records are huge, and Perl seems to be the only shell that can handle the huge lines. I am new to Perl, and am... (8 Replies)
i have a script in which i need to skip comments, and i am able to achieve it partially...
IN text file:
{****************************
{test : test...test }
Script:
while (<$fh>)
{
push ( @data, $_);
}
if ( $data =~ m/(^{\*+$)/ ){
}
With the above match i am... (5 Replies)
In the below perl code I am using tags within each line to extract certain information. The tags that are used are:
STB >0.8 is STRAND BIAS otherwise GOOD
FDP is the second number
GO towards the end of the line is read into an array and the value returned is outputed, in the first line that... (1 Reply)
In the perl below I am trying to extract and print specic values from patterns using multiple regex. One of the patterns AF= may be a whole number or a decimal but I can not seem
to capture both. I think it is the regex .*AF=(\d+\.\d+); as it is expecting a #.#### and it may only be a #. I tried... (2 Replies)
Hi,
I need some guidance with understanding this Perl script below. I am not the author of the script and the author has not leave any documentation. I supposed it is meant to be 'easy' if you're a Perl or regex guru. I am having problem understanding what regex to use :confused: The script does... (3 Replies)
Discussion started by: newbie_01
3 Replies
LEARN ABOUT FREEBSD
iscsictl
ISCSICTL(8) BSD System Manager's Manual ISCSICTL(8)NAME
iscsictl -- iSCSI initiator management utility
SYNOPSIS
iscsictl -A -p portal -t target [-u user -s secret]
iscsictl -A -d discovery-host [-u user -s secret]
iscsictl -A -a [-c path]
iscsictl -A -n nickname [-c path]
iscsictl -M -i session-id [-p portal] [-t target] [-u user] [-s secret]
iscsictl -M -i session-id [-n nickname [-c path]]
iscsictl -R [-p portal] [-t target]
iscsictl -R -a
iscsictl -R -n nickname [-c path]
iscsictl -L [-v]
DESCRIPTION
The iscsictl utility is used to configure the iSCSI initiator.
The following options are available:
-A Add session.
-M Modify session.
-R Remove session.
-L List sessions.
-a When adding, add all sessions defined in the configuration file. When removing, remove all currently established sessions.
-c Path to the configuration file. The default is /etc/iscsi.conf.
-d Target host name or address used for SendTargets discovery. When used, it will add a temporary discovery session. After discovery is
done, sessions will be added for each discovered target, and the temporary discovery session will be removed.
-i Session ID, as displayed by iscsictl -v.
-n The "nickname" of session defined in the configuration file.
-p Target portal - host name or address - for statically defined targets.
-s CHAP secret.
-t Target name.
-u CHAP login.
-v Verbose mode.
Certain parameters are necessary when adding a session. One can specify these either via command line (using the -t, -p, -u, and -s
options), or configuration file (using the -a or -n options). Some functionality - for example mutual CHAP - is available only via configu-
ration file.
Since connecting to the target is performed in background, non-zero exit status does not mean that the session was successfully established.
Use iscsictl -L to check the connection status.
Note that in order for the iSCSI initiator to be able to connect to a target, the iscsid(8) daemon must be running.
Also note that FreeBSD currently supports two different initiators: the old one, iscsi_initiator(4), with its control utility iscontrol(8),
and the new one, iscsi(4), with iscsictl and iscsid(8). The only thing the two have in common is the configuration file, iscsi.conf(5).
FILES
/etc/iscsi.conf iSCSI initiator configuration file.
EXIT STATUS
The iscsictl utility exits 0 on success, and >0 if an error occurs.
EXAMPLES
Attach to target iqn.2012-06.com.example:target0, served by 192.168.1.1:
iscsictl -A -t iqn.2012-06.com.example:target0 -p 192.168.1.1
Disconnect all iSCSI sessions:
iscsictl -Ra
SEE ALSO iscsi(4), iscsi.conf(5), iscsid(8)HISTORY
The iscsictl command appeared in FreeBSD 10.0.
AUTHORS
The iscsictl utility was developed by Edward Tomasz Napierala <trasz@FreeBSD.org> under sponsorship from the FreeBSD Foundation.
BSD September 12, 2014 BSD