Is there an option, for cat, head, tail, or is there any way, to display a file from last line to first? For example, my file
looks like this:
aaaa
bbbb
cccc
eeee
and I would like to print or display it like this:
eeee
cccc
bbbb
aaaa
thanks (5 Replies)
Hi, excuse me for my poor english.
My problem is that:
I have a File
i want to add to each line of that file two strings: one at the beginning of the line, one at the ending.
string1="abcd"
string2="efgh"
i want $string1 content $string2 for each line.
Is that possible? (3 Replies)
Hello -
I am running Linux. I want to place a comment char at the beginning of a line in a file. For example:
testvar=`grep username /etc/people
sed -e 's/$testvar/#$testvar/g' /etc/people
I cannot get the above commands to put a comment at the beginning of the line.
Any... (3 Replies)
Hello,
I have a file as follow
a
b
c
c
d
d
e
I would like to write a awk command to insert # from the first occurence of
"c" to the end of the files.
OUTPUT should be like this
a
b
#c (5 Replies)
How can I specify special meaning characters like ^ or $ inside a regex range. e.g
Suppose I want to search for a string that either starts with '|' character or begins with start-of-line character.
I tried the following but it does not work:
sed 's/\(\)/<do something here>/g' file1
... (3 Replies)
Well here goes:
I tried to write a batch file that adds a specific fixed text to each line of an already existing text file.
for the adding text infront of each line I tried this:
for /F "delims=" %%j in (list.txt) do echo.STARTTEXT\%%j >> list.txt
for adding text after each line I... (0 Replies)
How would you do vim copy line and paste at the beginning, middle, and end of another line. I know yy copies the whole line and p pastes the whole line, but on its own separate line. Sometimes I would like to copy a line to the beginning, middle, or end of another line. I would think this would be... (3 Replies)
I need to comment the lines starting with pattern "exclude" or "exclude=". If the work exclude comes at any other part, ignore it. Also, ignore, excludes, excluded etc. Ie only comment the line starting with exclude.
File contents.
exclude
exclude=
hi I am excluded
excludes
excludes=
... (9 Replies)
Hi,
I have a specific requirement to add text at the beginning and end of a plain text file. I tried to use "sed" with '1i' and '$a' flags but these required two separate "sed" commands separated with "|".
I am looking for some command/option to join these two in single command parameter.
... (6 Replies)
Discussion started by: bhupinder08
6 Replies
LEARN ABOUT DEBIAN
mdom::token::comment
MDOM::Token::Comment(3pm) User Contributed Perl Documentation MDOM::Token::Comment(3pm)NAME
MDOM::Token::Comment - A comment in Makefile source code
INHERITANCE
MDOM::Token::Comment
isa MDOM::Token
isa MDOM::Element
SYNOPSIS
# This is a MDOM::Token::Comment
foo: bar # So is this one
echo 'hello'
DESCRIPTION
In MDOM, comments are represented by "MDOM::Token::Comment" objects.
These come in two flavours, line comment and inline comments.
A "line comment" is a comment that stands on its own line. These comments hold their own newline and whitespace (both leading and trailing)
as part of the one "MDOM::Token::Comment" object.
An inline comment is a comment that appears after some code, and continues to the end of the line. This does not include whitespace, and
the terminating newlines is considered a separate MDOM::Token::Whitespace token.
This is largely a convenience, simplifying a lot of normal code relating to the common things people do with comments.
Most commonly, it means when you "prune" or "delete" a comment, a line comment disappears taking the entire line with it, and an inline
comment is removed from the inside of the line, allowing the newline to drop back onto the end of the code, as you would expect.
It also means you can move comments around in blocks much more easily.
For now, this is a suitably handy way to do things. However, I do reserve the right to change my mind on this one if it gets dangerously
anachronistic somewhere down the line.
METHODS
Only very limited methods are available, beyond those provided by our parent MDOM::Token and MDOM::Element classes.
line
The "line" accessor returns true if the "MDOM::Token::Comment" is a line comment, or false if it is an inline comment.
SUPPORT
See the support section in the main module.
AUTHOR
Adam Kennedy <adamk@cpan.org>
COPYRIGHT
Copyright 2001 - 2006 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.12.4 2011-08-28 MDOM::Token::Comment(3pm)