Sponsored Content
Top Forums Shell Programming and Scripting Grabbing variables and comparing Post 302225817 by kerpm on Sunday 17th of August 2008 06:03:24 AM
Old 08-17-2008
redoubtable,

Thanks. I need to run the script on the remote server and find the IP addresses of my home computers with dynamic IPs. I'm not sure if that is what the script is doing b/c it looks very complex and I don't really understand everything. In any event, ran the script and I got this error:

Bad arg length for Socket::inet_ntoa, length is 0, should be 4 at -e line 1, <> line 1.

Thanks again and thanks in advance if anyone else takes a crack at this.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

comparing variables

I have searched and found a few threads that have dealt with this, but the examples I've tried haven't seemed to help. I am monitoring our database log for high checkpoints. I can parse out the checkpoint value which can be anywhere from zero into a 3 digit number. I set a variable to be the... (3 Replies)
Discussion started by: MizzGail
3 Replies

2. Shell Programming and Scripting

Comparing two variables

Script #!/bin/sh hardware=PC os=WindowsNET for i in `cat newservers` do x=`sudo /opt/openv/netbackup/bin/admincmd/bpplclients |grep $i |head -40 |grep $i|awk '{print $3;exit}'` if then echo "$i is already added" else echo "Need to add" fi done O/p in debug mode bash-2.05$... (3 Replies)
Discussion started by: rajip23
3 Replies

3. Shell Programming and Scripting

Comparing Variables in Perl

Hi. I have three arrays. @a=('AB','CD','EF'); @b=('AB,'DG',HK'); @c=('DD','TT','MM'); I want to compare the elements of the first two array and if they match then so some substition. I tried using the if statement using the scalar value of the array but its not giving me any output. ... (7 Replies)
Discussion started by: kamitsin
7 Replies

4. UNIX for Dummies Questions & Answers

comparing variables

im trying to compare ipaddresses. i loop through an array to see if the ip is already is in the array and if it is it should set a flag and then i wont add it to the array. but its just adding all the ipaddresses to the array if ] then ... (3 Replies)
Discussion started by: magnia
3 Replies

5. Shell Programming and Scripting

Comparing multiple variables

Hi! I've come up with a ksh-script that produces one or more lists of hosts. At the and of the script, I would like to print only those hosts that exists in all the lists. Ex. HOSTS="host1 host2 host3 host11" HOSTS="host1 host2 host4" HOSTS="host2 host11" HOSTS="host2 host5 host6 host7... (1 Reply)
Discussion started by: Bugenhagen
1 Replies

6. Shell Programming and Scripting

comparing variables in an if statement

#!/bin/bash #timetest TIMENOW="$(date)" T1=12:00:00 echo $TIMENOW >timenow cat timenow |cut -f4 -d' ' >time1 T2=$(sed -n "${1}p" time1) echo "T1 = " $T1 echo "T2 = " $T2 if then echo $T1 else echo $T2 fi I thought scripting was simple! So why does this script result in: T1 =... (4 Replies)
Discussion started by: habuchas
4 Replies

7. Shell Programming and Scripting

awk comparing variables

Is there a way to compare variables in a 'awk'? I've been trying for a while and can't figure it out. I'm guessing its not possible :/ VAR=Bob awk '$3 == $VAR { print $1 }' file.txt Regards Jikuu (4 Replies)
Discussion started by: Jikuu
4 Replies

8. Shell Programming and Scripting

Comparing two variables

I have a script like this. Just couldn't get the comparison part work. Any thought? thanks, #!/usr/bin/ksh -x STEP=`echo $(basename $0 .ksh) | tr "" ""` log=/skip.log while read LINE do if then echo `date`: STEP $STEP skipped by user >> $log exit 0 fi done < $1 echo... (0 Replies)
Discussion started by: ghostmic
0 Replies

9. Shell Programming and Scripting

Grabbing text between two lines with shell variables.

I would like to grab complex html text between lines using variables. I am running Debian and using mksh shell. Here is the part of the html that I want to extract from. I would like to extract the words 'to love,' and I would like to use the above and below lines as reference points. ... (3 Replies)
Discussion started by: bedtime
3 Replies

10. UNIX for Beginners Questions & Answers

Comparing 2 variables in UNIX

Hi, I have 2 variables as given below. How can i compare them and say its matching ? Appreciate your help VAR1=describe/read/write VAR2=read/write/describeThanks, Please use CODE tags as required by forum rules! (4 Replies)
Discussion started by: prince1987
4 Replies
talk(1) 						      General Commands Manual							   talk(1)

NAME
talk - Converses with another user SYNOPSIS
talk user [tty_name] STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: talk: XCU5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. OPTIONS
None OPERANDS
The name of the desired recipient in the form returned by the who utility. [Tru64 UNIX] If the second user is on a remote host, the name of the host must be specified in one of the following ways: user@host host!user host.user host:user If the recipient is logged in more than once, the tty_name argument can be used to indicate the appropriate terminal name. If tty_name is not specified, the talk message is displayed on one or more accessible terminals in use by the recipient. The format of tty_name is the same as that returned by the who command. DESCRIPTION
The talk command allows two users to enter text simultaneously into windows displayed on each other's terminals. To initiate a conversa- tion, one user executes talk and specifies the second user's username. [Tru64 UNIX] When using full domain names, the only valid form for specifying the user and host is user@host. For example, andy@host17.dev.abc.com initiates a conversation with user andy at host host17 in the dev.abc.com domain. When the first user initiates the conversation, a message is sent to the second user. If the first user also specifies tty_name, the invi- tation message is sent to the specified terminal. Otherwise, the invitation is sent to the terminal on the remote host on which the second user first logged in. Once this invitation is received, talk displays two windows on the first user's terminal and displays progress mes- sages until the second user responds to the initial message. If the second user wants to have the conversation, the second user also executes talk from any terminal and specifies the first user's account name and hostname, if appropriate. If the second user accepts the invitation, talk displays two windows on the second user's ter- minal. One window displays what is typed by the local user; the other displays what is typed by the remote user. To end the conversation and close the connection, either user can press the Interrupt key sequence. If the second user does not want to permit talk invitations, that user should issue the mesg n command. The talk command processes characters as follows: Typing the <alert> character alerts the recipient's terminal. Typing <Ctrl-L> causes the sender's screen regions to be refreshed. Typing the Erase and Kill characters affects the sender's terminal as described on the termios reference page. Typing the Interrupt or End-of-File characters terminates the local talk program. Once the talk session has been termi- nated on one side, the other side of the session is notified that the talk session has been terminated and this side can do nothing except exit. Typing characters from LC_TYPE classifications print or space causes those characters to be sent to the recipient's terminal. The talk command fails when a user lacks the appropriate privileges to perform the requested action. NOTES
[Tru64 UNIX] The talk command uses the talk 4.3BSD protocol, which is not compatible with 4.2BSD versions of talk. EXIT STATUS
The following exit values are returned: Successful completion. An error occurred or your terminal is incapable of supporting talk. EXAMPLES
If john at host1 wants to talk to fred, who is logged in on host2, john enters: $ talk fred@host2 The following message is displayed on fred's terminal: Message from TalkDaemon@host1 at 15:16... talk: connection requested by john@host1. talk: respond with: talk john@host1 To accept the invitation, fred enters: $ talk john@host1 To talk to fred only if he is logged in on the console at host2, enter: $ talk fred@host2 console ENVIRONMENT VARIABLES
The following environment variables affect the execution of *cmd*: Provides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization vari- ables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value, overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multbyte characters in arguments and input files). If the recipient's locale does not use an LC_CTYPE equivalent to yours, the results are undefined. Determines the locale for the format and contents of diag- nostic messages written to standard error. Determines the location of message catalogues for the processing of LC_MESSAGES. SEE ALSO
Commands: mesg(1), named(8), stty(1), talkd(8), who(1), write(1) Standards: standards(5) talk(1)
All times are GMT -4. The time now is 06:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy