Sponsored Content
Top Forums Shell Programming and Scripting Run SQL command for a list of devices Post 302401147 by sureshcisco on Friday 5th of March 2010 04:18:44 AM
Old 03-05-2010
Run SQL command for a list of devices

Hi
Please help me to resolve.

Question:

I can run this command to change the mode of a device with id=500 as below

dbc "select device mode=3 where id=500;"

How can i run the same query with a file contaning n number of ids ?

file1.txt
12
234
34
500
34
45

Thanks in advance.
 

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
consadm(1m)						  System Administration Commands					       consadm(1m)

NAME
consadm - select or display devices used as auxiliary console devices SYNOPSIS
/usr/sbin/consadm /usr/sbin/consadm [-a device...] [-p] /usr/sbin/consadm [-d device...] [-p] /usr/sbin/consadm [-p] DESCRIPTION
consadm selects the hardware device or devices to be used as auxiliary console devices, or displays the current device. Only superusers are allowed to make or display auxiliary console device selections. Auxiliary console devices receive copies of console messages, and can be used as the console during single user mode. In particular, they receive kernel messages and messages directed to /dev/sysmsg. On Solaris x86 based systems they can also be used for interaction with the bootstrap. By default, selecting a display device to be used as an auxiliary console device selects that device for the duration the system remains up. If the administrator needs the selection to persist across reboots the -p option can be specified. consadm runs a daemon in the background, monitoring auxiliary console devices. Any devices that are disconnected (hang up, lose carrier) are removed from the auxiliary console device list, though not from the persistent list. While auxiliary console devices may have been removed from the device list receiving copies of console messages, those messages will always continue to be displayed by the default con- sole device. The daemon will not run if it finds there are not any auxiliary devices configured to monitor. Likewise, after the last auxiliary console is removed, the daemon will shut itself down. Therefore the daemon persists for only as long as auxiliary console devices remain active. See eeprom(1M) for instructions on assigning an auxiliary console device as the system console. OPTIONS
The following options are supported: -a device Adds device to the list of auxiliary console devices. Specify device as the path name to the device or devices to be added to the auxiliary console device list. -d device Removes device from the list of auxiliary console devices. Specify device as the path name to the device or devices to be removed from the auxiliary console device list. -p Prints the list of auxiliary consoles that will be auxiliary across reboots. When invoked with the -a or -d options , tells the application to make the change persist across reboot. EXAMPLES
Example 1 Adding to the list of devices that will receive console messages The following command adds /dev/term/a to the list of devices that will receive console messages. example# consadm -a /dev/term/a Example 2 Removing from the list of devices that will receive console messages The following command removes /dev/term/a from the list of devices that will receive console messages. This includes removal from the per- sistent list. example# consadm -d -p /dev/term/a Example 3 Printing the list of devices selected as auxiliary console devices The following command prints the name or names of the device or devices currently selected as auxiliary console devices. example# consadm ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of consadm: LC_CTYPE, LC_MESSAGES, and NLSPATH. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Stability Level |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
svcs(1), eeprom(1M), svcadm(1M), syslogd(1M), kadb(1M), environ(5), attributes(5), smf(5), sysmsg(7d), console(7d) NOTES
Auxiliary console devices are not usable for kadb or firmware I/O, do not receive panic messages, and do not receive output directed to /dev/console. The consadm service is managed by the service management facility, smf(5), under the service identifier: svc:/system/consadm Administrative actions on this service, such as enabling, disabling, or requesting restart, can be performed using svcadm(1M). The ser- vice's status can be queried using the svcs(1) command. SunOS 5.11 27 Oct 2004 consadm(1m)
All times are GMT -4. The time now is 04:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy