10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to create a shell script to add a user and modify its comment field mentioned in a file.
1.
File value:-
username comment field value
xyz123 xyztesting
abc123 abctesting
def123 deftesting
2. i am using below loop to create user... (2 Replies)
Discussion started by: Anil
2 Replies
2. UNIX for Beginners Questions & Answers
I have the following script, and I want to assign the output ($10 and $5) from awk to N and L:
grdinfo data.grd | awk '{print $10,$5}'| read N L
output from gridinfo data.grd is: data.grd 50 100 41 82 -2796 6944 0.016 0.016 3001 2461. where N and L is suppose to be 3001 and 100. I use... (8 Replies)
Discussion started by: geomarine
8 Replies
3. UNIX for Beginners Questions & Answers
Hi Team,
I am trying to grep date in a file but it is not working
#!/bin/bash
d=`date "+ %Y%m%d %H:%M"`
cd /scripts
/bin/rm -f test1
cat /var/logs/File.txt.0 |grep $"d" >v.txt instead it is showing the complete file output.
kindly suggest how should i grep this variable
it works... (7 Replies)
Discussion started by: scriptor
7 Replies
4. Shell Programming and Scripting
I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist.
diff=$1$2.diff
id=$2 new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff | awk... (2 Replies)
Discussion started by: Ashunayak
2 Replies
5. Shell Programming and Scripting
hi,
when we assign a variable inside a for loop or while loop in a shell script, does it loses its value after comming out of the loop. i am facing this issue.
can anyone help me?? (8 Replies)
Discussion started by: Little
8 Replies
6. Shell Programming and Scripting
Hi,
I'm trying to check if methods specified in a class have been added to the corrosponding interface.
My code below is giving me the following errors:
grep: function: No such file or directory
grep: import($zipfile): No such file or directory
grep: function: No such file or... (1 Reply)
Discussion started by: racshot65
1 Replies
7. Shell Programming and Scripting
Hi all
I run my program prog.c in the following way :
$ ./prog 1 > output.txt where 1 is a user defined initial value used by the program.
But now I want to run it for many a thousand initial values, 1-1000, and store all the outputs in different files.
Like
$ ./prog 1... (1 Reply)
Discussion started by: alice06
1 Replies
8. Shell Programming and Scripting
Dear All,
we have a command output which looks like :
Total 200 queues in 30000 Kbytes
and we're going to get "200" and "30000" for further process. currently, i'm using :
numA=echo $OUTPUT | awk '{print $2}'
numB=echo $OUTPUT | awk '{print $5}'
my question is : can I use just one... (4 Replies)
Discussion started by: tiger2000
4 Replies
9. Shell Programming and Scripting
I am a newbie to awk and c programming, however am not a unix newbie. However, I do need help with a kshell script I am writing. It is almost complete, the last step is killing me. Any help would be greatly appreciated. What I am trying to do is cat a text file that has usernames. Then, using... (2 Replies)
Discussion started by: synergy_texas
2 Replies
10. UNIX for Dummies Questions & Answers
Hi all,
I'm having some trouble with a shell script that I have put together to search our web pages for links to PDFs.
The first thing I did was:
ls -R | grep .pdf > /tmp/dave_pdfs.outWhich generates a list of all of the PDFs on the server. For the sake of arguement, say it looks like... (8 Replies)
Discussion started by: Dave Stockdale
8 Replies
IO::Async::Loop::Epoll(3pm) User Contributed Perl Documentation IO::Async::Loop::Epoll(3pm)
NAME
IO::Async::Loop::Epoll - use "IO::Async" with "epoll" on Linux
SYNOPSIS
use IO::Async::Loop::Epoll;
use IO::Async::Stream;
use IO::Async::Signal;
my $loop = IO::Async::Loop::Epoll->new();
$loop->add( IO::Async::Stream->new(
read_handle => *STDIN,
on_read => sub {
my ( $self, $buffref ) = @_;
while( $$buffref =~ s/^(.*)
?
// ) {
print "You said: $1
";
}
},
) );
$loop->add( IO::Async::Signal->new(
name => 'INT',
on_receipt => sub {
print "SIGINT, will now quit
";
$loop->loop_stop;
},
) );
$loop->loop_forever();
DESCRIPTION
This subclass of IO::Async::Loop uses IO::Epoll to perform read-ready and write-ready tests so that the O(1) high-performance multiplexing
of Linux's epoll_pwait(2) syscall can be used.
The "epoll" Linux subsystem uses a registration system similar to the higher level IO::Poll object wrapper, meaning that better performance
can be achieved in programs using a large number of filehandles. Each epoll_pwait(2) syscall only has an overhead proportional to the
number of ready filehandles, rather than the total number being watched. For more detail, see the epoll(7) manpage.
This class uses the epoll_pwait(2) system call, which atomically switches the process's signal mask, performs a wait exactly as
epoll_wait(2) would, then switches it back. This allows a process to block the signals it cares about, but switch in an empty signal mask
during the poll, allowing it to handle file IO and signals concurrently.
CONSTRUCTOR
$loop = IO::Async::Loop::Epoll->new()
This function returns a new instance of a "IO::Async::Loop::Epoll" object.
METHODS
As this is a subclass of IO::Async::Loop, all of its methods are inherited. Expect where noted below, all of the class's methods behave
identically to "IO::Async::Loop".
$count = $loop->loop_once( $timeout )
This method calls the "poll()" method on the stored "IO::Epoll" object, passing in the value of $timeout, and processes the results of that
call. It returns the total number of "IO::Async::Notifier" callbacks invoked, or "undef" if the underlying "epoll_pwait()" method returned
an error. If the "epoll_pwait()" was interrupted by a signal, then 0 is returned instead.
SEE ALSO
o IO::Epoll - Scalable IO Multiplexing for Linux 2.5.44 and higher
o IO::Async::Loop::Poll - use IO::Async with poll(2)
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>
perl v5.14.2 2012-04-10 IO::Async::Loop::Epoll(3pm)