I have a variable and assigned the following values
***XYZ_201519_20150929140642_20150929140644_211_0_0_211
I need to read this variable from backward and stop read when I get first underscore (_)
In this scenario I should get 211
Thanks
Kris
Hello Kris,
You could try following too.
Output will be as follows.
In case you need to read from a Input_file then following may help.
Thanks,
R. Singh
I may not being doing this description justice, but I'll give it a try.
I created a mailx script; there will be several messages using the same script where the only difference is the content. So I figured I'd make the content of the message a variable retrieved from a separate file. I have five... (5 Replies)
Hi,
I like to set a variable "name" automatically by reading an xml file. My code looks like this:
set name = `awk '/<generationTime>/,/<\/generationTime>/ p' $xml_name`
the "name" is thus set to
<generationTime>2004-12-01T08:23:50.000000</generationTime>
How can I separate this line,... (3 Replies)
Hi,
I like to set a variable "name" automatically by reading an xml file. The name should be set to the date, which is a part of the following line of the xml file:
<sceneID>C82_N32_A_SM_strip_008_R_2009-11-24T04:22:12.790028Z</sceneID>
How can I separate this line, that the name will... (6 Replies)
Hello,
I have following problem.
I have the result of a database request. I preparated the result via sed, etc. as a string in a file.
The string in the file is:
($3==1 || $3==2 || $3==3 || $3==4)
Now I want to use the String as a command in an if-statement.
So I assigned the string to a... (3 Replies)
Hi friends,
I want to select and use the certain part of a line. For example I have the following line
home/1245/hgdf/acsdf/myhome/afolder/H2O/endfile
how can I extract the part " /myhome/afolder/H2O/endfile "
thanks (6 Replies)
Hi,
I am working on one script..I am having files in the below format
file 1 (each line is separated with : delimeter)
SPLASH:SPLASH:SVN
CIB/MCH:MCH:SVN
Now I want from file 1 that most left part of the first line will store in... (6 Replies)
Hello Friends,
I need a command (or script line) that allows me to use of a part of line (given by me) as a variable. Let us assume the name of the command is MYCMD.
When I type
MYCMD fish://mfong@vhl.gov.nd/homefolder/hhk/ADS/
it must do the following job
cd /homefolder/hhk/ADS/
... (18 Replies)
Hi,
I have 80 large files, from which I want to get a specific value to run a Bash script. Firstly, I want to get the part of a file which contains this:
Name =A
xxxxxx
yyyyyy
zzzzzz
aaaaaa
bbbbbb
Value = 57
This is necessary because in a file there are written more lines which... (6 Replies)
All,
I have a log file containing lots of data now i want to extract all text between block below(names) without the title or end pattern but only names,
++++START++++
SCOTT TIGER
HENRY PAUL
JARED OTIENO
OMOLLO JA NIGERIA
++++END++++
the names i want to return and store in a variable in... (1 Reply)
I need some help. I would like to read in a text file.
Take a variable such as ROW-D-01, compare it to what's in one line in the text file such as PROD/VM/ROW-D-01 and only input PROD/VM into a variable without the /ROW-D-01.
Is this possible? any help is appreciated. (2 Replies)
Discussion started by: xChristopher
2 Replies
LEARN ABOUT DEBIAN
dpkg::buildoptions
Dpkg::BuildOptions(3) libdpkg-perl Dpkg::BuildOptions(3)NAME
Dpkg::BuildOptions - parse and update build options
DESCRIPTION
The Dpkg::BuildOptions object can be used to manipulate options stored in environment variables like DEB_BUILD_OPTIONS and
DEB_BUILD_MAINT_OPTIONS.
FUNCTIONS
my $bo = Dpkg::BuildOptions->new(%opts)
Create a new Dpkg::BuildOptions object. It will be initialized based on the value of the environment variable named $opts{'envvar'} (or
DEB_BUILD_OPTIONS if that option is not set).
$bo->reset()
Reset the object to not have any option (it's empty).
$bo->merge($content, $source)
Merge the options set in $content and record that they come from the source $source. $source is mainly used in warning messages
currently to indicate where invalid options have been detected.
$content is a space separated list of options with optional assigned values like "nocheck parallel=2".
$bo->set($option, $value, [$source])
Store the given option in the objet with the given value. It's legitimate for a value to be undefined if the option is a simple boolean
(its presence means true, its absence means false). The $source is optional and indicates where the option comes from.
The known options have their values checked for sanity. Options without values have their value removed and options with invalid values
are discarded.
$bo->get($option)
Return the value associated to the option. It might be undef even if the option exists. You might want to check with $bo->has($option)
to verify if the option is stored in the object.
$bo->has($option)
Returns a boolean indicating whether the option is stored in the object.
$string = $bo->output($fh)
Return a string representation of the build options suitable to be assigned to an environment variable. Can optionnaly output that
string to the given filehandle.
$bo->export([$var])
Export the build options to the given environment variable. If omitted, the environment variable defined at creation time is assumed.
The value set to the variable is also returned.
CHANGES
Version 1.01
Enable to use another environment variable instead of DEB_BUILD_OPTIONS. Thus add support for the "envvar" option at creation time.
AUTHOR
Raphael Hertzog <hertzog@debian.org>
1.16.15 2014-06-05 Dpkg::BuildOptions(3)