Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Getting error while using date as a variable in expect Post 303021051 by RudiC on Friday 3rd of August 2018 07:08:00 AM
Old 08-03-2018
Network error / glitch? Is that reproducible? Any error messages?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to check date variable according to the current date?

Hi folks, I need to write a script that should activate a process according to the current hour. The process should be activatet only if the hour is between midnight (00:00) and 07:00. How should I create the condition? Thanks in advance, Nir (2 Replies)
Discussion started by: nir_s
2 Replies

2. Shell Programming and Scripting

Transfer variable to an expect function

Hi There, I try to transfer a variable from the script to a function which use expect, but I don't succed. #!/bin/sh HPPASS1="$2" send_command() { echo "spawn ssh login@10.10.10.10" echo 'set password ' echo 'sleep 1' echo 'expect "*assword:*"'... (5 Replies)
Discussion started by: sylvainkalache
5 Replies

3. Shell Programming and Scripting

passing variable to expect

Please tell me how to pass variable "a b c" to expect from the shell script 1/ example of input file # cat in-file var1 var2 a b c var4 2/ # this is my script - how to pass "a b c" as single variable ? cat in-file | while read x do my-expect x done 3/ # expect script - how to... (0 Replies)
Discussion started by: breaktime123
0 Replies

4. Shell Programming and Scripting

Assigning last line to variable in expect

As part of an expect script, I have to convert a strange user ID to a conventional UNIX ID. To do this, I read the contents of a file and do a little awk magic. Here's that bit of the expect script: send "awk 'NF == 10 && \$NF == strange_user_id {print \$(NF-2)}' file_with_my_info\r" expect... (0 Replies)
Discussion started by: treesloth
0 Replies

5. Shell Programming and Scripting

How to pass variable with spaces from shell to expect?

I need call expect script from shell script and pass values some of which could contain space. How to make expect to treat such values as one variable? (1 Reply)
Discussion started by: urello
1 Replies

6. Shell Programming and Scripting

LINUX ---> Add one date to a date variable

Hi All, I am trying to add one day to the busdt variable i am extracting from a file (DynamicParam.env). I am deriving the busdt as below. Is there any function which I can use to derive as below. If busdt=20120910, then the new derived variable value should be 20120911 If... (2 Replies)
Discussion started by: dsfreddie
2 Replies

7. Shell Programming and Scripting

Python get the expect value from a variable

the value of the variable is yes group=bsp_16 keyword="82599" test_var="-a xxx -b yyy" I want to get output with -a xxx -b yyy (0 Replies)
Discussion started by: yanglei_fage
0 Replies

8. Shell Programming and Scripting

Convert a date stored in a variable to epoch date

I am not able to pass date stored in a variable as an argument to date command. I get current date value for from_date and to_date #!/usr/bin/ksh set -x for s in server ; do ssh -T $s <<-EOF from_date="12-Jan-2015 12:02:09" to_date="24-Jan-2015 13:02:09" echo \$from_date echo... (7 Replies)
Discussion started by: raj48
7 Replies

9. Shell Programming and Scripting

Expect Redirecting o/p to an Variable

I have a password reset expect script which stores all the op to an file. I need to check the whether password is successfully changed by greping out the file and storing the o/p to a variable. But we try to print the variable , its shows only the command instead of its o/p. ... (2 Replies)
Discussion started by: sudharson
2 Replies

10. UNIX for Beginners Questions & Answers

How to replace a parameter(variable) date value inside a text files daily with current date?

Hello All, we what we call a parameter file (.txt) where my application read dynamic values when the job is triggered, one of such values are below: abc.txt ------------------ line1 line2 line3 $$EDWS_DATE_INSERT=08-27-2019 line4 $$EDWS_PREV_DATE_INSERT=08-26-2019 I am trying to... (1 Reply)
Discussion started by: pradeepp
1 Replies
getdomainname(2)						System Calls Manual						  getdomainname(2)

NAME
getdomainname, setdomainname - get or set name of current Network Information Service domain SYNOPSIS
DESCRIPTION
returns the name of the Network Information Service (NIS) domain for the current processor, as previously set by The parameter namelen specifies the size of the name array. The returned value is null-terminated unless the area pointed to by name is not large enough to hold the domain name plus the null byte. In this case, only the namelen number of bytes is returned. sets the domain of the host machine to name, which has a length of namelen. This call is restricted to the superuser and is normally used only when the system is booted. These Network Information Service domains enable two distinct networks with common host names to merge. Each network is distinguished by having a different domain name. Currently, only the Network Information Service uses these domains. RETURN VALUE
If the call succeeds, a value of 0 is returned. If the call fails, a value of -1 is returned and is set to indicate the error. ERRORS
If or fail, is set to one of the following values: name points outside the accessible address space. The caller is not superuser. This error only applies to WARNINGS
The length of the name array should be at least 65; NIS domain names can be up to 64 characters long. NIS servers use the NIS domain name as the name of a subdirectory of Since the NIS domain name can be as long as 64 characters, the domain name set with can exceed the maximum file name length allowed on the local file system. If that length is exceeded, the name of the subdi- rectory is the truncated NIS domain name. AUTHOR
getdomainname was developed by Sun Microsystems, Inc. SEE ALSO
domainname(1), ypserv(1M), ypfiles(4). getdomainname(2)
All times are GMT -4. The time now is 02:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy