10-23-2008
hi again. i'm afraid it still doesn't work. I'm thinking it is because it should be;
while (true)
whereas i am doing;
while (not true)
while ("$DPID" != "")
I've done further tests to try and get the expression to work and think it must be to do with the operators.
effectively i need to say whil DPID IS SOMETHING
i have just tried this but it doesn't echo the text in the while script so is not working;
while ("$DPID" =~ "*")
Cheers if anyone can take a look.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have this script:
-------------------------------------------------------
#!/bin/ksh
#
if ] ||
]
then
echo "Executing main_load.sh script"
/usr1/psc_load/jobs/cron/main_load.sh "ods"
else
echo "File not found, do nothing"
fi
exit 0
... (4 Replies)
Discussion started by: rose1207
4 Replies
2. Shell Programming and Scripting
Hi All,
I have a requirement as below.
I supposed to get a file from Source system once in a month. But we dont know when the source system will send the file. My script has to wait for that file in LOOP once it gets the file then it has to FTP the file.
I thought of scheduling the job... (5 Replies)
Discussion started by: Raamc
5 Replies
3. Shell Programming and Scripting
Hi Gurus,
Could you please help me to create a shell script that will be started by a cron job once every night at 24.00 h (that should bee easy:))
The shell script should control every 30 seconds the name of a process, and when the process doesn't run anymore it should execute a few further... (12 Replies)
Discussion started by: blackwire
12 Replies
4. Shell Programming and Scripting
Hi ,
I have a csh code below which check the process if it's running.
Can any expert advise me on the following:
1) what does this notationmean ">!" and how is it different from the append ">" notation ?
2) how does "setenv" work in this code ?
# Check whether there is a running... (3 Replies)
Discussion started by: Raynon
3 Replies
5. UNIX and Linux Applications
Hi
I would like to check if an instance of a script is already running.
I've seen many different examples, but I haven't the slightest idea as to how to do this.
Can you please help.
Thank you. (5 Replies)
Discussion started by: ladyAnne
5 Replies
6. Programming
How to I check if a process is running in C? I'm trying to use ps aux |grep "process name" but failing in doing that. How do I do that?
Thanks, (1 Reply)
Discussion started by: cprogdude
1 Replies
7. Shell Programming and Scripting
Hi,
I check if the process is running or not using the below.
/usr/ucb/ps auxww | grep 109 |grep rmi | awk '{print $2}'
9718
Thus we see 9718 is the PID.
It return blank if the process is not running.
I need to perform some action if the process is not running and leave it if... (8 Replies)
Discussion started by: shifahim
8 Replies
8. UNIX for Dummies Questions & Answers
I have process1 running on one machine and generating some log file. Now another process which can be launched on any machine wants to know if process1 is running or not and also in case it is running it wants to stream the logs file generated by process1 on terminal from which process2 is... (2 Replies)
Discussion started by: saurabhnsit2001
2 Replies
9. Shell Programming and Scripting
Hi,
I have a script which triggers an infinite loop.
#!bin/bash
trig=`ls /home/trig.tch |wc -l`
function callj {
some commands...
}
while
do
callj &
done
The number of process after doing a ps -ef |grep Mon.sh returns
processes even after the script is killed by deleting the... (4 Replies)
Discussion started by: chetan.c
4 Replies
10. Shell Programming and Scripting
cd /opt/et/WAS/apps/8.0
find . -name "HostIntegration.properties" -o -name "HostSocket.properties" -o -name "environment.properties" 2> /dev/null | awk -F '' '{print $4}'|awk '!x++' | cat>/home/cbadmin/file1.txt
cd /home/cbadmin/
PS3='Please enter a number from list of applications==>:'
select... (3 Replies)
Discussion started by: bhas85
3 Replies
LEARN ABOUT OSX
syntax::keyword::junction
Syntax::Keyword::Junction(3) User Contributed Perl Documentation Syntax::Keyword::Junction(3)
NAME
Syntax::Keyword::Junction - Perl6 style Junction operators in Perl5
VERSION
version 0.003001
SYNOPSIS
use Syntax::Keyword::Junction qw/ all any none one /;
if (any(@grant) eq 'su') {
...
}
if (all($foo, $bar) >= 10) {
...
}
if (qr/^d+$/ == all(@answers)) {
...
}
if (all(@input) <= @limits) {
...
}
if (none(@pass) eq 'password') {
...
}
if (one(@answer) == 42) {
...
}
or if you want to rename an export, use Sub::Exporter options:
use Syntax::Keyword::Junction any => { -as => 'robot_any' };
if (robot_any(@grant) eq 'su') {
...
}
DESCRIPTION
This is a lightweight module which provides 'Junction' operators, the most commonly used being "any" and "all".
Inspired by the Perl6 design docs, <http://dev.perl.org/perl6/doc/design/exe/E06.html>.
Provides a limited subset of the functionality of Quantum::Superpositions, see "SEE ALSO" for comment.
Notice in the "SYNOPSIS" above, that if you want to match against a regular expression, you must use "==" or "!=". Not "=~" or "!~". You
must also use a regex object, such as "qr/d/", not a plain regex such as "/d/".
SUBROUTINES
all()
Returns an object which overloads the following operators:
'<', '<=', '>', '>=', '==', '!=',
'lt', 'le', 'gt', 'ge', 'eq', 'ne',
'~~'
Returns true only if all arguments test true according to the operator used.
any()
Returns an object which overloads the following operators:
'<', '<=', '>', '>=', '==', '!=',
'lt', 'le', 'gt', 'ge', 'eq', 'ne',
'~~'
Returns true if any argument tests true according to the operator used.
none()
Returns an object which overloads the following operators:
'<', '<=', '>', '>=', '==', '!=',
'lt', 'le', 'gt', 'ge', 'eq', 'ne',
'~~'
Returns true only if no argument tests true according to the operator used.
one()
Returns an object which overloads the following operators:
'<', '<=', '>', '>=', '==', '!=',
'lt', 'le', 'gt', 'ge', 'eq', 'ne',
'~~'
Returns true only if one and only one argument tests true according to the operator used.
ALTERING JUNCTIONS
You cannot alter junctions. Instead, you can create new junctions out of old junctions. You can do this by calling the "values" method on
a junction.
my $numbers = any(qw/1 2 3 4 5/);
print $numbers == 3 ? 'Yes' : 'No'; # Yes
$numbers = any( grep { $_ != 3 } $numbers->values );
print $numbers == 3 ? 'Yes' : 'No'; # No
You can also use the "map" method:
my $numbers = any(qw/1 2 3 4 5/);
my $prime = $numbers->map( &is_prime );
say for $prime->values; # prints 0, 1, 1, 0, 1
EXPORT
'all', 'any', 'none', 'one', as requested.
All subroutines can be called by its fully qualified name, if you don't want to export them.
use Syntax::Keyword::Junction;
if (Syntax::Keyword::Junction::any( @questions )) {
...
}
WARNING
When comparing against a regular expression, you must remember to use a regular expression object: "qr/d/" Not "/d/". You must also use
either "==" or "!=". This is because "=~" and "!~" cannot be overriden.
TO DO
Add overloading for arithmetic operators, such that this works:
$result = any(2,3,4) * 2;
if ($result == 8) {...}
SEE ALSO
This module is actually a fork of Perl6::Junction with very few (initial) changes. The reason being that we want to avoid the incendiary
name containing Perl6.
Quantum::Superpositions provides the same functionality as this, and more. However, this module provides this limited functionality at a
much greater runtime speed, with my benchmarks showing between 500% and 6000% improvment.
<http://dev.perl.org/perl6/doc/design/exe/E06.html> - "The Wonderful World of Junctions".
AUTHORS
o Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>
o Carl Franks
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Arthur Axel "fREW" Schmidt.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.16.2 2012-09-02 Syntax::Keyword::Junction(3)