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
RCTEST(1)																 RCTEST(1)

NAME
rctest - RFCOMM testing SYNOPSIS
rctest <mode> [options] [bdaddr] DESCRIPTION
rctest is used to test RFCOMM communications on the BlueZ stack MODES
-r listen and receive -w listen and send -d listen and dump incoming data -s connect and send -u connect and receive -n connect and be silent -c connect, disconnect, connect, ... -m multiple connects OPTIONS
-b bytes send/receive bytes bytes -i device select the specified device -P channel select the specified channel -U uuid select the specified uuid -L seconds enable SO_LINGER options for seconds -W seconds enable deferred setup for seconds -B filename use data packets from filename -N num send num frames -C num send num frames before delay (default: 1) -D milliseconds delay milliseconds after sending num frames (default: 0) -A request authentication -E request encryption -S secure connection -M become master -T enable timestamps AUTHORS
Written by Marcel Holtmann <marcel@holtmann.org> and Maxim Krasnyansky <maxk@qualcomm.com>, man page by Filippo Giunchedi <fil- ippo@debian.org> BlueZ Jul 6 2009 RCTEST(1)
All times are GMT -4. The time now is 01:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy