Perl: One action if an element doesn't exist in array
Hello,
I want to run one (not multiple) action if an element doesn't exist in array.
for example:
the output of this simple script:
But what I want to do is printing only one "number not found" or on other words, run one action if number doesn't exist in the array.
As part of a NIS implementation, (I think) I want to create a group (in /etc/group) that has users that do not exist on the target machine.
What effect will this have? Will it cause any problems?
Thanks,
Gary Cooper (1 Reply)
Probably I am not seeing it or I am not using the "delete" correctly I had the following codes but it does not work for me
#!/bin/perl -w
...
@sysFile1 = (a_b, a_c, a_d);
@sysFile2 = (a_c, a_e, b_f);
foreach $line1 (@sysFile1){
trim(\$line1);
(my $tmp1, my $tmp2) = split/_/,... (6 Replies)
Hello guys,
I have the following question.
Consider the following code in PERL
for($xeAnumber=0; $xeAnumber<@xeAnumber; $xeAnumber++)
{
if(@xeAnumber==@final_file)
{
@final_file=@xeTimeStamp;
}... (3 Replies)
I have a script that is working:
#!/bin/bash
sftp user@domain.com <<EOF
cd somedir
mget *.csv
quit
EOF
but on a crontab I want to only pull newer files, so I want to do something like:
while read ls current dir local file != true do
mget that new file
but I'm not sure the syntax... (2 Replies)
Hey,
I'm currently getting into some kernel module progamming. As a little exercise I want to read the headers out of an ELF file. My code is very simple, here is the important part:
struct file *fp;
/* ... */
fp = filp_open("some/file/on/my/pc", O_RDONLY, 0);
if(fp == NULL) {
... (15 Replies)
Hi, How to get previous/next element in the array perl
Example
@queue = (1, 2 ,3 , 4);
I want to get value of 1 and 2, or, 2 and 3, or 3 and 4...etc and compare to value which one is greater to do that I need to get previous and next element of array ? (1 Reply)
Hii all,
i create the user
useradd -d /home/kk kk
passwd kk
when i tried to login to kk
i get a error user directory doesn't exist
then i tried
useradd kkk
passwd kkkwhen i tried to login to kkk
i get the same error user directory doesn't exist. (4 Replies)
Hi All,
I am new to perl I am stuck in simple problem I need your help
I want to define a subroutine.
sub check_if_entity_exists(@array_to_be_checked,$entityName)
I have array as
http-listener-1
http-listener-2
http-listener-3
http-listener-4
If i send http-listener-3 my... (1 Reply)
Hello,
I'm attempting to write a tool that checks an IP address for existing PTR records then if there are no PTR records does a ping to see if it response.
Then if there is no response, it should print a message saying
This is what I have so far.
#!/usr/bin/perl
$nxdomain =... (4 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
I'm able to create a group but when I'm trying to delete the group it keeps stating Group Doesn't Exist. I know... (2 Replies)
Discussion started by: GoBoyGo
2 Replies
LEARN ABOUT CENTOS
avahi-dnsconfd.action
avahi-dnsconfd.action(8) System Manager's Manual avahi-dnsconfd.action(8)NAME
avahi-dnsconfd.action - avahi-dnsconfd action script
SYNOPSIS
/home/lennart/tmp/avahi/etc/avahi/avahi-dnsconfd.action
DESCRIPTION
avahi-dnsconfd.action is the action script that is called whenever a new unicast DNS server is found or removed by avahi-dnsconfd. The
default script as shipped with avahi patches /etc/resolv.conf to reflect the changed unicast DNS server configuration.
PARAMETERS
argv[1] Contains the character "+" if the DNS server is new, "-" when it shall be removed from the DNS server list.
argv[2] The IP address of the DNS server.
argv[3] Numerical network interface number this DNS server was found on.
argv[4] Numerical protocol number this DNS server was found on. (usually 2 for IPv4 and 10 for IPv6)
ENVIRONMENT
AVAHI_INTERFACE Contains the textual interface name the corresponds with argv[3]. (e.g. "eth0")
AVAHI_INTERFACE_DNS_SERVERS Contains a list of all DNS servers that avahi-dnsconfd found on the interface $AVAHI_INTERFACE, separated by
spaces.
AVAHI_DNS_SERVERS Contains a list of all DNS server that avahi-dnsconfd found on all interfaces, separated by spaces.
AUTHORS
The Avahi Developers <avahi (at) lists (dot) freedesktop (dot) org>; Avahi is available from http://avahi.org/
SEE ALSO avahi-dnsconfd(8), avahi-daemon(8)COMMENTS
This man page was written using xml2man(1) by Oliver Kurth.
Manuals User avahi-dnsconfd.action(8)