Sponsored Content
Top Forums Shell Programming and Scripting Looping through a shell script with sql statements Post 302360400 by novice82 on Thursday 8th of October 2009 10:12:10 PM
Old 10-08-2009
Thanks Pettero for your assistance
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Running remote shell script containing sql statements

I have a shell script which resides on three SCO machines containing some simple sqlplus statments. I need to run these scripts remotely. Currently, I am trying to use rsh to do so: rsh hostname myscript args The problem is that the arguments to the sqlplus statements in the remote shell... (4 Replies)
Discussion started by: Madbreaks
4 Replies

2. Shell Programming and Scripting

looping through a variable in a shell script

hi, my first question is :- i would like to know how do i loop through the output of a variable. for ex:- if i have a variable called x and echo $x gives the output like feb 19 07 feb 20 07 feb 21 07 i would like to know how do i loop through this since it is separated and i... (1 Reply)
Discussion started by: ramachandranrr
1 Replies

3. Shell Programming and Scripting

Convert shell script for looping

Situation: I have a working shell script on our file server (OSXS Tiger) to connect to a workstation, which is using a portable home directory (phd), and rsync a user's MirrorAgent.log. I'm not that strong of a scripter (obviously), but I would like to add other workstations to this script as they... (4 Replies)
Discussion started by: le0pard13
4 Replies

4. Shell Programming and Scripting

Calling SQL LDR and SQL plus scripts in a shell script

Hi- I am trying to achieve the following in a script so I can schedule it on a cron job. I am fairly new to the unix environment... I have written a shell script that reads a flat file and loads the data into an Oracle table (Table1) via SQLLDR. This Works fine. Then, I run a nested insert... (5 Replies)
Discussion started by: rajagavini
5 Replies

5. Solaris

Automate SQL statements

Hello, On unix side, I have written below script for taking oracle db backup. But when I tried to execute it - i could not execute the sql statements from unix. Please suggest ------------------------ $ more bkp.sh #!/bin/ksh # make sure database is shutdown cleanly sqlplus '/ as sysdba'... (3 Replies)
Discussion started by: panchpan
3 Replies

6. Shell Programming and Scripting

looping some statements

Hi, assume there are some dir structure like - I need to write a script to create 5 new directories under 'qwe' dir of all the above 3 dir structures. these 5 dir will have same name. I don't want to use 15 mkdir statements. i just want to write 5 mkdir statemets and use them 3 times. I... (10 Replies)
Discussion started by: Sriranga
10 Replies

7. Shell Programming and Scripting

Can we use two shebang statements in a single shell script?

Hi, As per my understanding, we can use two shebang statements in a single shell script. Please see below snippet- #!/bin/bash .......## some code A #!/bin/csh .......## some code B exit 0; Here, code A will be executed using bash shell and code B will be executed with c shell. ... (9 Replies)
Discussion started by: tarunmudgal4u
9 Replies

8. Shell Programming and Scripting

Nested looping statements

I cannot get the code below to work correctly. The IF statement works just fine, but not the looping. The inner loop tries to find files for a given vendor; if found, I need to sleep giving another process time to move the files. Once the given vendor's files are gone, then I want to move on to the... (1 Reply)
Discussion started by: dgreene
1 Replies

9. Shell Programming and Scripting

Looping not completing in shell script

Hi, Iam using below code to login to servers to get cpu utilisation. but output is coming for only one server. code is below root@blr-svr-oclan-01 # more SSSC_CPU_UTIL1.sh #!/bin/sh echo "CPU UTILIZATION" while read line; do IDLE=`/usr/local/bin/sshpass -p 'xxx' ssh xxx@$line 'sar 2 2' |... (1 Reply)
Discussion started by: surender reddy
1 Replies

10. Programming

Shell script - if statements dont work

hi all, i have made a shell script and it runs until it reaches the if statement, doesn't the ! mean only if the command fails it will echo me that message and then exit can anyone please help me what is wrong with my code? many thanks, rob #!/bin/bash echo "is this archive... (10 Replies)
Discussion started by: robertkwild
10 Replies
IEEE1284_TRANSFER(3)						     Functions						      IEEE1284_TRANSFER(3)

NAME
ieee1284_nibble_read, ieee1284_compat_write, ieee1284_byte_read, ieee1284_epp_read_data, ieee1284_epp_write_data, ieee1284_epp_read_addr, ieee1284_epp_write_addr, ieee1284_ecp_read_data, ieee1284_ecp_write_data, ieee1284_ecp_read_addr, ieee1284_ecp_write_addr - data transfer functions SYNOPSIS
#include <ieee1284.h> ssize_t ieee1284_nibble_read(struct parport *port, int flags, char *buffer, size_t len); ssize_t ieee1284_compat_write(struct parport *port, int flags, const char *buffer, size_t len); ssize_t ieee1284_byte_read(struct parport *port, int flags, char *buffer, size_t len); ssize_t ieee1284_epp_read_data(struct parport *port, int flags, char *buffer, size_t len); ssize_t ieee1284_epp_write_data(struct parport *port, int flags, const char *buffer, size_t len); ssize_t ieee1284_epp_read_addr(struct parport *port, int flags, char *buffer, size_t len); ssize_t ieee1284_epp_write_addr(struct parport *port, int flags, const char *buffer, size_t len); ssize_t ieee1284_ecp_read_data(struct parport *port, int flags, char *buffer, size_t len); ssize_t ieee1284_ecp_write_data(struct parport *port, int flags, const char *buffer, size_t len); ssize_t ieee1284_ecp_read_addr(struct parport *port, int flags, char *buffer, size_t len); ssize_t ieee1284_ecp_write_addr(struct parport *port, int flags, const char *buffer, size_t len); DESCRIPTION
This set of functions is for tranferring bytes in the relevant transfer mode. For ECP and EPP modes two types of transfer are possible: data and address (usually referred to as channel in ECP). The supplied port must be a claimed port. The supplied buffer must be at least len bytes long. When reading, the transferred data is stored in the buffer; when writing the data to be transferred is taken from the buffer. For reads (peripheral to host): if no data is available and F1284_NONBLOCK is not in effect, the inactivity timer is started. If data becomes available before the inactivity time-out elapses it is read; otherwise the return value will be E1284_TIMEDOUT. For writes (host to peripheral): if the peripheral is not willing to accept data and F1284_NONBLOCK is not in effect, the inactivity timer is started. If the peripheral indicates that it is willing to accept data before the inactivity time-out elapses it is sent; otherwise the return value will be E1284_TIMEDOUT The flags may alter the behaviour slightly: F1284_NONBLOCK For reads (peripheral to host): if no data is available, return immediately (with E1284_TIMEDOUT). For writes (host to peripheral): if the peripheral is not willing to accept data, return immediately (with E1284_TIMEDOUT). F1284_SWE Don't use hardware assistance for the transfer, but instead set the parallel port pins according to the wire protocol. F1284_RLE (for ECP only) Use run length encoding. If the peripheral is in ECP mode with RLE, calls to ieee1284_ecp_read_data must set this flag in order for the RLE from the peripheral to be interpreted correctly, and calls to ieee1284_ecp_write_data may set this flag in order to take advantage of RLE. F1284_FASTEPP (for EPP only) Use multi-byte transfers. Several bytes at a time are transferred using hardware assistance, if supporting hardware is present. The price of this increased speed is that the return value will be less reliable when this flag is used. For ECP mode, a given direction is in force at any particular time, and it is up to the application to ensure that it is only writing when in forward mode, and reading when in reverse mode. RETURN VALUE
The return value is the number of bytes successfully transferred or, if negative, one of: E1284_NOTIMPL This transfer mode and flags combination is not yet implemented in libieee1284. E1284_TIMEDOUT Timed out waiting for peripheral to handshake. E1284_NOMEM Not enough memory is available. E1284_SYS There was a problem at the operating system level. The global variable errno has been set appropriately. E1284_INVALIDPORT The port parameter is invalid (for instance, perhaps the port is not claimed). If any bytes are successfully transferred, that number is returned. An error is returned only if no bytes are transferred. For host-to-peripheral transfers, all data is at the peripheral by the time the call returns. SEE ALSO
ieee1284_ecp_fwd_to_rev(3) AUTHOR
Tim Waugh <twaugh@redhat.com> Author. COPYRIGHT
Copyright (C) 2001-2003 Tim Waugh 09/18/2007 IEEE1284_TRANSFER(3)
All times are GMT -4. The time now is 08:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy