I'm new here. I was wondering why I can't store a host lookup in a variable.
Result: "ip" command not found .. so how would I store the host lookup in the variable?
Basically I have IP's stored in a file and want to check them via rdns if they include the string "bot". If they dont I want to save them in blacklist2, if they do in blacklist3.
If anyone could help me out with this I'd be grateful... I'm pretty new to this and so far I really like how easy it is to write some useful scripts, but this is a bit too difficult for me.
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
Hi All,
I need to store the real seconds of the following command in a variable. How could it be done?
time $(dd if=/dev/zero of=/dev/sda1 bs=512 count=2048;sync)
Thanks,
Amio (12 Replies)
I intend to find the path/full location of a file(filename given by user thru "read filenme") using "find" or any other command and then store it's output in a variable for some other processing.
But struggling to put all things together (i.e finding the fully qualified location of that file and... (4 Replies)
p="-e"
echo $p
It is not returning the value "-e" stored. Instead returns null.
I am wondering how could this happen. Please help me out.I tried all possibilities like p='-e' | p="\-e". Nothing seems to work.
:confused::confused: (10 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hello,
I want to gzip some files before copying to remote host. There is no freespace on source host so it needs to be perfomed within one-liner. I tried the following but it didn't work
gzip -c -9 all_rvds.xml |ssh targethost "dd of=/tmp/all_rvds.xml.gz"
cat all_rvds.xml |gzip -c9 |ssh... (5 Replies)
Please can you help me understand the significance of providing arguments under sh -s in
> ssh -qtt ${user}@${host} "sh -s "${version}"" < test.sh (4 Replies)
Hi All,
I need to get the version of python installed and store it in a variable for later use. Whereas it is printing on the console instead of storing to variable. I am able to store output of ls command in a variable. Please check the below code :
root@myhost:/volumes/srini# cat... (4 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
LEARN ABOUT DEBIAN
ares_gethostbyname_file
ARES_GETHOSTBYNAME(3) Library Functions Manual ARES_GETHOSTBYNAME(3)NAME
ares_gethostbyname_file - Lookup a name in the system's hosts file
SYNOPSIS
#include <ares.h>
int ares_gethostbyname_file(ares_channel channel, const char *name,
int family, struct hostent **host)
DESCRIPTION
The ares_gethostbyname_file function performs a host lookup by name against the system's hosts file (or equivalent local hostname data-
base). The channel parameter is required, but no asynchronous queries are performed. Instead, the lookup is done via the same mechanism
used to perform 'f' lookups (see the lookups options field in ares_init_options(3)). The parameter name gives the hostname as a NUL-termi-
nated C string, and family gives the desired type of address for the resulting host entry.
The return value indicates whether the query succeeded and, if not, how it failed. It may have any of the following values:
ARES_SUCCESS The host lookup completed successfully and host now points to the result (and must be freed with ares_free_hostent(3)).
ARES_ENOTFOUND The hostname name was not found.
ARES_EFILE There was a file I/O error while performing the lookup.
ARES_ENOMEM Memory was exhausted.
On successful completion of the query, the pointer pointed to by host points to a struct hostent containing the address of the host
returned by the lookup. The user must free the memory pointed to by host when finished with it by calling ares_free_hostent(3). If the
lookup did not complete successfully, host will be NULL.
AVAILABILITY
Added in c-ares 1.5.4
SEE ALSO ares_gethostbyname(3), ares_free_hostent(3), ares_init_options(3)AUTHOR
Brad Spencer
Copyright 1998 by the Massachusetts Institute of Technology.
25 July 1998 ARES_GETHOSTBYNAME(3)