In bash you could simplify the logic as -t will timeout if a full line is not received
Under zsh -t is just a timeout for the first character being available. Use return value of read to detect a timeout, as REPLY is not emptied on timeout:
Last edited by Chubler_XL; 01-03-2018 at 09:30 PM..
I am trying to write a korn shell script which posts commands to a server and read the response back from the server.
Any idea how I can read the servers response?
I have tried doing the following:
(
LOGIN:xxxxx
command to server
read ANSWER
echo $ANSWER >file1... (4 Replies)
Hi ALL:
I am not able to get the response back from weblogic in the shell script.
The weblogic server in different account. I am able to login to that account and bring the server up but while doing a ping, the script is failing. While the same script is running fine if I run it on the account... (1 Reply)
I have a shell script that is building a string that consists of the parts of a command that I want run at the end of the string. So it looks like this:
$PART1=/path/to/command
$PART2="-arg1"
$PART3="-arg2"
and so on.
At the end of the command is a list of files I get from a loop and... (2 Replies)
My company has a private network, including a Apache web server (Linux) and some WinXP machines. The web server had been configured to use mod_proxy to connect to window update site via another company proxy server. It works for few years.
Recently, some parties had setup a DNS server on the... (2 Replies)
Hi - I am getting the error
`Error reading response length from authentication socket'
when I ssh from my cluster to another cluster, and then back to my cluster. It doesn't seem to affect anything, but it's just annoying that it always pops up and tends to confuse new users of the cluster. I... (1 Reply)
How can I get a bash script to wait and read and count $i messages that a running program (drbl clonezilla) sends to the console (terminal) and only then move on to the next line in the script when the count is matched (the next line is the last line of the script and is a reboot)?
The script... (0 Replies)
Is there hopefully a way to search for an exact string in Man Pages? I know if I want to search for anything containing -c I can just do this.
/-c
How would I search for "-c"? I want only "-c" to show up. So I tried this.
/"-c"
It took me literally and looked for the quotes also. (13 Replies)
Solaris terminal responding very slow .. we have recently put a T3 hardware in to production , the applications running are it are perfectly and no complaints from user ..but when i ssh to the server ... the terminal response is very very slow .. it takes 3 seconds to show the character i type ..... (3 Replies)
Hi All,
I have a requirement to read response file which looks like below
Ex:
NAME=SAM
DOB=01/01/1980
ADDRESS=
7658 James Street
NewYork
0000
Now, I need to take NAME, DOB, ADDRESS into variables
I am fine taking NAME and DOB
I need help on how can I... (6 Replies)
I don't know if you guys get this problem sometimes at Terminal but I had been having this problem since yesterday :( Maybe I overdid the Terminal. Even the codes that used to work doesn't work anymore.
Here is what 's happening:
* I wanted to remove lines containing digits so I used this... (25 Replies)
Discussion started by: Nexeu
25 Replies
LEARN ABOUT OPENSOLARIS
tty
tty(1) User Commands tty(1)NAME
tty - return user's terminal name
SYNOPSIS
tty [-l] [-s]
DESCRIPTION
The tty utility writes to the standard output the name of the terminal that is open as standard input. The name that is used is equivalent
to the string that would be returned by the ttyname(3C) function.
OPTIONS
The following options are supported:
-l Prints the synchronous line number to which the user's terminal is connected, if it is on an active synchronous line.
-s Inhibits printing of the terminal path name, allowing one to test just the exit status.
ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of tty: LANG, LC_ALL, LC_CTYPE, LC_MES-
SAGES, and NLSPATH.
EXIT STATUS
The following exit values are returned:
0 Standard input is a terminal.
1 Standard input is not a terminal.
>1 An error occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
|CSI |Enabled |
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
|Standard |standards(5). |
+-----------------------------+-----------------------------+
SEE ALSO isatty(3C), ttyname(3C), attributes(5), environ(5), standards(5)DIAGNOSTICS
not on an active synchronous line
The standard input is not a synchronous terminal and -l is specified.
not a tty
The standard input is not a terminal and -s is not specified.
NOTES
The -s option is useful only if the exit status is wanted. It does not rely on the ability to form a valid path name. Portable applications
should use test -t.
SunOS 5.11 1 Feb 1995 tty(1)