If you're using a 1993 or later version of the Korn shell:
will yield:
If you're using a recent bash:
produces the same output.
Both of these suggestions use parameter expansions that are extensions that are allowed, but not specified, by the standards.
This User Gave Thanks to Don Cragun For This Post:
I am trying to strip all leading and trailing spaces of a shell variable using either awk or sed or any other utility, however unscuccessful and need your help.
echo $SH_VAR | command_line Syntax.
The SH_VAR contains embedded spaces which needs to be preserved. I need only for the leading and... (6 Replies)
I have a file that looks like this:
/home/fred/opt/bin
/opt/usr/bin
/usr/sbin/var/opt
I need a way to chop of everything after the last occurance of the / sign including the /. So the file above will now look like this below.
/home/fred/opt
/opt/usr
/usr/sbin/var
I tried using... (6 Replies)
Hello, I am (trying) to write a script that will check to see how many users are logged on to my machine, and if that number is more than 60 I need to kill off all the oldest sessions that are over 60. So far I have been able to check how many users are on and now I am at the part where I have to... (3 Replies)
HI
In my script, i am reading the input from the user and want to find the length of the string.
The input may contain leading spaces. Right now, when leading spaces are there, they are not counted.
Kindly help me
My script is like below. I am using the ksh.
#!/usr/bin/ksh
echo... (2 Replies)
I have a list of servers that I need my script to ping however this list also has the env they belong too such as SIT, PRD, warehouse and so on.
The break character for each section is :
A value in my list would look like this...
brutus.grhq.xxx.com:warehouse
Where brutus.grhq.gfs.com is... (13 Replies)
awk -F"\t" -vOFS="\t" '{print $1"\t-\t-","",$6,$7"\t-"$8"\t-\t-\t"$15}' file.tsv > output.tsv
Using the above command how to remove the string www.abc.com from the $7 value. (7 Replies)
Ok so I know the title was probably confusing so here goes: I have a tarball (gzipped) that has a nested directory structure . For example:
my.tar.gz (contents)
---
------
---------
------------
---------------
... (2 Replies)
Hi... can anyone please tell how do i strip off the leading filename from the wc -l command....
when i fire command
wc -l new1
... its giving output as
14 new1
i want the output as just '14'...
i need to use this value in the calculations in the later part of the script..... (2 Replies)
Hi,
i have a variable which conatins values like 00001,0003,00067,00459.
I want to use the values one by one and in the same form as they are like 00001,0003,00067,00459.
Also can anyone tell me how to increment those numbers by 1,keeping the format as same like 00002,0004,00068,00460.... (5 Replies)
I have a text file with a line of text that contains numbers and text formatted into groups. I need to extract the number that can be either 1,2 or 3 digits long. Then write it to a variable, but i need to remove any leading spaces in the number first.
I can get the numbers out but how to remove... (12 Replies)
Discussion started by: kcpoole
12 Replies
LEARN ABOUT CENTOS
pod::simple::linksection
Pod::Simple::LinkSection(3) User Contributed Perl Documentation Pod::Simple::LinkSection(3)NAME
Pod::Simple::LinkSection -- represent "section" attributes of L codes
SYNOPSIS
# a long story
DESCRIPTION
This class is not of interest to general users.
Pod::Simple uses this class for representing the value of the "section" attribute of "L" start-element events. Most applications can just
use the normal stringification of objects of this class; they stringify to just the text content of the section, such as "foo" for
"L<Stuff/foo>", and "bar" for "L<Stuff/bI<ar>>".
However, anyone particularly interested in getting the full value of the treelet, can just traverse the content of the treeleet
@$treelet_object. To wit:
% perl -MData::Dumper -e
"use base qw(Pod::Simple::Methody);
sub start_L { print Dumper($_[1]{'section'} ) }
__PACKAGE__->new->parse_string_document('=head1 L<Foo/bI<ar>baz>>')
"
Output:
$VAR1 = bless( [
'',
{},
'b',
bless( [
'I',
{},
'ar'
], 'Pod::Simple::LinkSection' ),
'baz'
], 'Pod::Simple::LinkSection' );
But stringify it and you get just the text content:
% perl -MData::Dumper -e
"use base qw(Pod::Simple::Methody);
sub start_L { print Dumper( '' . $_[1]{'section'} ) }
__PACKAGE__->new->parse_string_document('=head1 L<Foo/bI<ar>baz>>')
"
Output:
$VAR1 = 'barbaz';
SEE ALSO
Pod::Simple
SUPPORT
Questions or discussion about POD and Pod::Simple should be sent to the pod-people@perl.org mail list. Send an empty email to
pod-people-subscribe@perl.org to subscribe.
This module is managed in an open GitHub repository, <https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or to clone
<git://github.com/theory/pod-simple.git> and send patches!
Patches against Pod::Simple are welcome. Please send bug reports to <bug-pod-simple@rt.cpan.org>.
COPYRIGHT AND DISCLAIMERS
Copyright (c) 2004 Sean M. Burke.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of
merchantability or fitness for a particular purpose.
AUTHOR
Pod::Simple was created by Sean M. Burke <sburke@cpan.org>. But don't bother him, he's retired.
Pod::Simple is maintained by:
o Allison Randal "allison@perl.org"
o Hans Dieter Pearcey "hdp@cpan.org"
o David E. Wheeler "dwheeler@cpan.org"
perl v5.16.3 2013-05-03 Pod::Simple::LinkSection(3)