04-25-2013
Ping shell script - need urgent help
Hi friends,
i have a file contains IP address like below
cat file.txt
10.223.20.1
10.223.20.2
10.223.20.3
10.223.20.4
10.223.10.5
.
.
.
like this
Now i want to make a script which gives output whether each ip is pinging or not...
the result will be like this
10.223.20.1 up
10.223.20.2 up
10.223.20.3 down
10.223.20.4 up
10.223.20.5 down
please friends please give me quick reply
please please
---------- Post updated at 03:51 AM ---------- Previous update was at 03:36 AM ----------
Hi friends, this is seriously something urgent task to do...
could you please help me on urgent basis?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Dear all,
This is the Bionic Fysh again. I have two quick questions:
1- when writing shell scripts, how does one allow the tilda ~ into the script ?
e.g
ls ~;
ls ~me;
user=you;
ls ~$user (N.B I think that for this one you need: ls `~$user`)
2- In FreeBSD 4.0, I would like for a... (6 Replies)
Discussion started by: bionicfysh
6 Replies
2. Shell Programming and Scripting
Hi,
I need help urgently for following issue. Pls help me to resolve this issue.
I am calling sql script file(file1.sql) from UNIX Shell Script(script1.ksh) using sql plus and trying to create flat file that contains all records returned from SQL query in SQL script(file1.sql)
I given... (6 Replies)
Discussion started by: praka
6 Replies
3. Shell Programming and Scripting
Hi
Can someone give me a shell script that can ping a range of IPs and return IPs which are not pingable.
Range for example say 192.168.0.1 to 192.168.0.50 and whichever are not pingable then return the IP.
Thanks for your help (3 Replies)
Discussion started by: tannu
3 Replies
4. Shell Programming and Scripting
hi anyone,
i want shell script for ping command.
any one post here............ (10 Replies)
Discussion started by: rameshreddy.ema
10 Replies
5. Shell Programming and Scripting
I woul like to create a script in order to make a ping to a server and save in a variable a 1 if respond or a 0 if it doesnt. Then with that I could make a graffic of the server, for how long it is up.:b:
So far I have this:
if ;
then
#if the ip respond the ping shows online
echo... (3 Replies)
Discussion started by: jsebastiang0
3 Replies
6. Shell Programming and Scripting
Hi,
I need to ping all the systems in my network and then create a log for the ones, from where I successfully get the ping-response (ICMP packet).
Now, I've used the ping command successfully, but am unable to use 'grep' command to locate the IPs for which the ping was successful (so that I... (5 Replies)
Discussion started by: psychoTHEIST
5 Replies
7. Shell Programming and Scripting
Hi Team,
Need shell script to Telnet multiple node , Ping some IP and print output like pass or fail.
Need this script to check reachability of multiple nodes at same time.
Help me.
I use this but not working...
Eg.
in this script i need to telnet... (4 Replies)
Discussion started by: Ganesh Mankar
4 Replies
8. Shell Programming and Scripting
I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being... (1 Reply)
Discussion started by: Gurdza32
1 Replies
9. Shell Programming and Scripting
Hi
I did the following script to ping multiple servers, but I keep on receiveing duplicate emails for one server that is down:
#!/bin/bash
date
cat /var/tmp/servers.list | while read output
do
ping -c 1 "$output" > /dev/null
if ; then
echo "node $output is up"
else
... (10 Replies)
Discussion started by: fretagi
10 Replies
10. Shell Programming and Scripting
Hello,
I have below string, even I have hundreds of lines in a file. I want to exactly match last two consecutive strings.
2017-09-30|ACBD,TVF|01234|NULL|18|NULL|686091802|BANK OF ABCD, LIMITED, THE|2017-09-30 00:00:00
I want to extract the string 2017-09-30 00:00:00
How can I do... (1 Reply)
Discussion started by: shellquery26666
1 Replies
LEARN ABOUT NETBSD
npm-run-script
NPM-RUN-SCRIPT(1) NPM-RUN-SCRIPT(1)
NAME
npm-run-script - Run arbitrary package scripts
SYNOPSIS
npm run-script <command> [--silent] [-- <args>...]
alias: npm run
DESCRIPTION
This runs an arbitrary command from a package's "scripts" object. If no "command" is provided, it will list the available scripts.
run[-script] is used by the test, start, restart, and stop commands, but can be called directly, as well. When the scripts in the package
are printed out, they're separated into lifecycle (test, start, restart) and directly-run scripts.
As of ` https://blog.npmjs.org/post/98131109725/npm-2-0-0, you can use custom arguments when executing scripts. The special option -- is
used by getopt https://goo.gl/KxMmtG to delimit the end of the options. npm will pass all the arguments after the -- directly to your
script:
npm run test -- --grep="pattern"
The arguments will only be passed to the script specified after npm run and not to any pre or post script.
The env script is a special built-in command that can be used to list environment variables that will be available to the script at run-
time. If an "env" command is defined in your package, it will take precedence over the built-in.
In addition to the shell's pre-existing PATH, npm run adds node_modules/.bin to the PATH provided to scripts. Any binaries provided by
locally-installed dependencies can be used without the node_modules/.bin prefix. For example, if there is a devDependency on tap in your
package, you should write:
"scripts": {"test": "tap test/*.js"}
instead of
"scripts": {"test": "node_modules/.bin/tap test/*.js"}
to run your tests.
The actual shell your script is run within is platform dependent. By default, on Unix-like systems it is the /bin/sh command, on Windows it
is the cmd.exe. The actual shell referred to by /bin/sh also depends on the system. As of `
https://github.com/npm/npm/releases/tag/v5.1.0 you can customize the shell with the script-shell configuration.
Scripts are run from the root of the module, regardless of what your current working directory is when you call npm run. If you want your
script to use different behavior based on what subdirectory you're in, you can use the INIT_CWD environment variable, which holds the full
path you were in when you ran npm run.
npm run sets the NODE environment variable to the node executable with which npm is executed. Also, if the --scripts-prepend-node-path is
passed, the directory within which node resides is added to the PATH. If --scripts-prepend-node-path=auto is passed (which has been the
default in npm v3), this is only performed when that node executable is not found in the PATH.
If you try to run a script without having a node_modules directory and it fails, you will be given a warning to run npm install, just in
case you've forgotten.
You can use the --silent flag to prevent showing npm ERR! output on error.
You can use the --if-present flag to avoid exiting with a non-zero exit code when the script is undefined. This lets you run potentially
undefined scripts without breaking the execution chain.
SEE ALSO
o npm help 7 scripts
o npm help test
o npm help start
o npm help restart
o npm help stop
o npm help 7 config
January 2019 NPM-RUN-SCRIPT(1)