04-22-2020
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have to run a script shell on a unix server from my windows PC. For that, I open a cmd windows and use Telnet to connect to the unix and run the script (by the .profile of a special user). Is it possible to automate Telnet in order to not enter the user and the password ?
Anyway, has... (4 Replies)
Discussion started by: tbeghain
4 Replies
2. UNIX for Advanced & Expert Users
This is my first post so hello to all of you!
I have a script in bash-3.00 that needs to execute the following:
pkgrm (to remove an existing package)
pkgadd -d ( to install a new package)
The problem is that both commands prompt me to answer either y,n or q in order to proceed with... (13 Replies)
Discussion started by: Insight
13 Replies
3. Shell Programming and Scripting
Hi all,
I am currently running a daemon which creates a virtual terminal for testing purposes. Essentially, if I were to interact with it manually, this is what I get.
john@test1:~$telnet localhost 7777
Trying ::1...
Connected to localhost.
Escape character is '^]'
mip6d> pl
eth2... (6 Replies)
Discussion started by: abxccd
6 Replies
4. Shell Programming and Scripting
HI,
In some test cases, I used tools like "dd" and "shed" to manually read a block from the disk, modify it using a hex editor and write it back using "dd".
I need help with some linux commands I can use to read the block and change the data to induce the corruption....as I want to automate my... (3 Replies)
Discussion started by: prinsh
3 Replies
5. Shell Programming and Scripting
I am connecting to a device using telnet, I want my script to perform certain commands : ie- show device , show inventory..etc and write the output it sees from the terminal to a file.
this is what I have got :
#!/usr/bin/expect --
set running 1
spawn telnet <ip address>
expect ... (1 Reply)
Discussion started by: samantha123
1 Replies
6. Shell Programming and Scripting
hi,
i've bash script thats working...
but now i need to add a line....that prompts for user input....like yes and 1 as complete install....
so here's how it looks...
$ cd 9200 (cd into directory)
$./install (hv to type ./install to run install then ask for)
----do you want to... (4 Replies)
Discussion started by: kernel11
4 Replies
7. Shell Programming and Scripting
i have to connect windows server from one of the unix box so i am using telnet and below is my following code
#!/bin/sh
host=hostname
log=loginid
port=23
pass=password
cmd1=mkdir test1234
( echo open ${host} ${port}
sleep 1
echo ${log}
sleep 3
echo "\r\n"
sleep 3
echo ${pass}... (11 Replies)
Discussion started by: chandan.p
11 Replies
8. Open Source
Hello!
Need help to write a Linux script that can be run from windows using command/Cygwin/any other way. I am new to scripting, actually i am trying to automate server health check like free disk space, memory along with few services status, if any services is not running then start services ,... (7 Replies)
Discussion started by: Sayed Ibrahim
7 Replies
9. UNIX for Beginners Questions & Answers
Hi Guys,
this is the scenario:
ubuntu pc and I have 10 wireless devices that I need to check their firmware version.
I would like to create a script that it will ask me IP, after I enter it, I hit enter then it will show me the version of the firmware.
this is what i do.
ssh... (9 Replies)
Discussion started by: gabak
9 Replies
10. UNIX for Beginners Questions & Answers
I am new in scripting,
I need script(BASH) which do telenet to one of the elements & run few commands , after running it successfully it will check status of files & exit.
Help is greatly appreciated 🙏 (2 Replies)
Discussion started by: Vinesh_123
2 Replies
ECVT(3) BSD Library Functions Manual ECVT(3)
NAME
ecvt, fcvt, gcvt -- convert double to ASCII string
SYNOPSIS
#include <stdlib.h>
char *
ecvt(double value, int ndigit, int * restrict decpt, int * restrict sign);
char *
fcvt(double value, int ndigit, int * restrict decpt, int * restrict sign);
char *
gcvt(double value, int ndigit, char *buf);
DESCRIPTION
These functions are provided for compatibility with legacy code. New code should use the snprintf(3) function for improved safety and porta-
bility.
The ecvt(), fcvt() and gcvt() functions convert the double precision floating-point number value to a NUL-terminated ASCII string.
The ecvt() function converts value to a NUL-terminated string of exactly ndigit digits and returns a pointer to that string. The result is
padded with zeroes from left to right as needed. There are no leading zeroes unless value itself is 0. The least significant digit is
rounded in an implementation-dependent manner. The position of the decimal point relative to the beginning of the string is stored in decpt.
A negative value indicates that the decimal point is located to the left of the returned digits (this occurs when there is no whole number
component to value). If value is zero, it is unspecified whether the integer pointed to by decpt will be 0 or 1. The decimal point itself
is not included in the returned string. If the sign of the result is negative, the integer pointed to by sign is non-zero; otherwise, it is
0.
If the converted value is out of range or is not representable, the contents of the returned string are unspecified.
The fcvt() function is identical to ecvt() with the exception that ndigit specifies the number of digits after the decimal point (zero-padded
as needed).
The gcvt() function converts value to a NUL-terminated string similar to the %g printf(3) format specifier and stores the result in buf. It
produces ndigit significant digits similar to the %f printf(3) format specifier where possible. If ndigit does allow sufficient precision,
the result is stored in exponential notation similar to the %e printf(3) format specifier. If value is less than zero, buf will be prefixed
with a minus sign. A decimal point is included in the returned string if value is not a whole number. Unlike the ecvt() and fcvt() func-
tions, buf is not zero-padded.
RETURN VALUES
The ecvt(), fcvt() and gcvt() functions return a NUL-terminated string representation of value.
WARNINGS
The ecvt() and fcvt() functions return a pointer to internal storage space that will be overwritten by subsequent calls to either function.
The maximum possible precision of the return value is limited by the precision of a double and may not be the same on all architectures.
The snprintf(3) function is preferred over these functions for new code.
SEE ALSO
printf(3), strtod(3)
STANDARDS
The ecvt(), fcvt() and gcvt() functions conform to IEEE Std 1003.1-2001 (``POSIX.1'').
BSD
May 31, 2007 BSD