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)
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)
how to add value/word at the beginning of each line in a file ?
i have file number.txt and the output is below
1000
1001
1002
1003
1004
i want to add 000 at the beginning of each line, desire output is below
0001000
0001001
0001002
0001003
0001004
and so on
please advise how... (5 Replies)
My file has the entries like below...
/dev/sds
/dev/sdak
/dev/sdbc
/dev/sdbu
I want to make the file like below
echo 1 > /sys/block/sds/device/rescan
echo 1 > /sys/block/sdak/device/rescan
echo 1 > /sys/block/sdbc/device/rescan
echo 1 > /sys/block/sdbu/device/rescan (2 Replies)
Discussion started by: saravanapandi
2 Replies
LEARN ABOUT DEBIAN
filesys::notify::simple
Filesys::Notify::Simple(3pm) User Contributed Perl Documentation Filesys::Notify::Simple(3pm)NAME
Filesys::Notify::Simple - Simple and dumb file system watcher
SYNOPSIS
use Filesys::Notify::Simple;
my $watcher = Filesys::Notify::Simple->new([ "." ]);
$watcher->wait(sub {
for my $event (@_) {
$event->{path} # full path of the file updated
}
});
DESCRIPTION
Filesys::Notify::Simple is a simple but unified interface to get notifications of changes to a given filesystem path. It utilizes inotify2
on Linux and fsevents on OS X if they're installed, with a fallback to the full directory scan if they're not available.
There are some limitations in this module. If you don't like it, use File::ChangeNotify.
o There is no file name based filter. Do it in your own code.
o You can not get types of events (created, updated, deleted).
o Currently "wait" method blocks.
In return, this module doesn't depend on any non-core modules. Platform specific optimizations with Linux::Inotify2 and Mac::FSEvents are
truely optional.
AUTHOR
Tatsuhiko Miyagawa <miyagawa@bulknews.net>
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
File::ChangeNotify Mac::FSEvents Linux::Inotify2
perl v5.12.4 2011-09-27 Filesys::Notify::Simple(3pm)