Sponsored Content
Top Forums Shell Programming and Scripting Run SQL command for a list of devices Post 302401149 by Franklin52 on Friday 5th of March 2010 04:29:58 AM
Old 03-05-2010
Use a loop, something like:
Code:
#/bin/sh

while read num
do
  sqlstring="select device mode=3 where id="$num";"
  dbc "$sqlstring"
done < file1.txt

 

10 More Discussions You Might Find Interesting

1. HP-UX

list of devices

Hi, I need to rediracte all the names of the devices (only disks) to a file. Thanks:confused: (3 Replies)
Discussion started by: yoavbe
3 Replies

2. Shell Programming and Scripting

Perl - run sub routine for list of devices

Hi, Can anyone please correct the script such that it run on all the devices in the devicelist.txt file. The problem is when the script runs it only reads the first device in the list, configures the device and exists. Script: The devicelist.txt: device.crs... (1 Reply)
Discussion started by: sureshcisco
1 Replies

3. Shell Programming and Scripting

how to run an already made script run against a list of ip addresses solaris 8 question

how to run an already developed script run against a list of ip addresses solaris 8 question. the script goes away and check traffic information, for example check_GE-VLANStats-P3 1.1.1.1 and returns the results ok. how do I run this against an ip list? i.e a list of 30 ip addresses (26 Replies)
Discussion started by: llcooljatt
26 Replies

4. Shell Programming and Scripting

Run SQL thru shell script: how to get a new line when run sql query?

Hi, this's Pom. I'm quite a new one for shell script but I have to do sql on shell script to query some information from database. I found a concern to get a new line...When I run my script, it retrieves all data as wondering but it's shown in one line :( What should I do? I'm not sure that... (2 Replies)
Discussion started by: Kapom
2 Replies

5. Shell Programming and Scripting

Script for telnet and run one command kill it and run another command using while loop

( sleep 3 echo ${LOGIN} sleep 2 echo ${PSWD} sleep 2 while read line do echo "$line" PID=$? sleep 2 kill -9 $PID done < temp sleep 5 echo "exit" ) | telnet ${HOST} while is executing only command and exits. (5 Replies)
Discussion started by: sooda
5 Replies

6. UNIX for Dummies Questions & Answers

Read workstation list from file und run command

Hi, how do I read in a file which includes a list of workstations and then run a command for each workstation ? I am unclear which command to use to read in , or is this not possible ? Thanks, (3 Replies)
Discussion started by: manni2
3 Replies

7. Shell Programming and Scripting

Perl: connect to network devices, run set of commands

I am trying to write a script for my own use that will allow me to connect to network devices, then run a set of commands. I start with a list of ips in a text file. Each ip is on its own line. I start with a second file of commands. Each command on one line. for illustration .. the cmd.txt... (2 Replies)
Discussion started by: popeye
2 Replies

8. Shell Programming and Scripting

Storing multiple sql queries output into variable by running sql command only once

Hi All, I want to run multiple sql queries and store the data in variable but i want to use sql command only once. Is there a way without running sql command twice and storing.Please advise. Eg : Select 'Query 1 output' from dual; Select 'Query 2 output' from dual; I want to... (3 Replies)
Discussion started by: Rokkesh
3 Replies

9. UNIX for Beginners Questions & Answers

ARP and Bonjour to build list of user devices

Hi, I want to build a list of the devices that are connected to my network and refresh that list every 10th minute (using an RPi with Raspbian). The host names are obtained by using Bonjour which is easily installed by: sudo apt-get install libnss-mdns To build the list manually, I do like... (2 Replies)
Discussion started by: Zooma
2 Replies

10. Shell Programming and Scripting

Script to run #groups command on list in a file

I have to provide a listing of all usernames and group assignments on Linux servers running SLES 12 SP 3. I am trying to automate this via a #for loop. It is not doing as desired and could use a little assistance. Here is the code: #!/bin/bash for uname in 'cat $(hostname)_unlist.txt' do... (8 Replies)
Discussion started by: Kentlee65
8 Replies
PCONSOLE(1)						      General Commands Manual						       PCONSOLE(1)

NAME
pconsole - parallel console shell for administering clusters. SYNOPSIS
pconsole DESCRIPTION
pconsole allows you to connect to each node of your cluster simultaneously, and you can type your administrative commands in a specialized window that 'multiplies' the input to each of the connections you have opened. pconsole is best run from within X Windows, although it is possible to employ it without X (in console mode) as well. You need to install pconsole on only 1 machine in the cluster, this would usually be your central administrative node. OPTIONS
pconsole need to be executed with superuser permissions, and enters in interactive mode let you attach other devices so that all the com- mands sent to the console mode of pconsole are sent to the devices. This allows you to parallelize the execution of the same command in various machines at a time. pconsole has two working modes: command mode From this mode pconsole can attach and dettach devices, list the attached devices at a time, connect to sending mode where you can send commands to the attached devices, and quit. To enter in command mode, use CTRL-A from sending mode. sending mode The mode where the commands sent to it are sent to the devices attached. To enter this mode use CTRL-D or use the console command. SEE ALSO
/usr/share/doc/pconsole/README.gz xterm(1) AUTHOR
This manual page was written by Jesus Climent <jesus.climent@hispalinux.es>, for the Debian GNU/Linux system (but may be used by others). PCONSOLE(1)
All times are GMT -4. The time now is 09:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy