Sponsored Content
Full Discussion: How to catch the output
Top Forums Shell Programming and Scripting How to catch the output Post 302171715 by adderek on Friday 29th of February 2008 08:47:34 AM
Old 02-29-2008
Maybe this is what you wanted to do ?
print "select * from myTable" | sqlplus user/pass > output_file
or
print "select * from myTable" | sqlplus user/pass | some other commands

If not then you could try to use 'expect'.

Probably you could do something like
sqlplus user/pass >output_file <<EOF
select * from myTable
EOF
but this is not readable IMHO (and I am not sure which from the above would work).

A hint: ksh/sh/etc. don't have database support. Maybe PERL or something else would be a better choice?
In my company I am always seeing that some guys are using incorrect tools (especially some guys from India who knows only C# and tend to make everything in it - like to rewrite unix applications whar require adding extra communication/interface modules.... this is really sad).
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

how to catch information in a different environment .....

Hi , under a Telnet connection on AIX system , i'm using an ascii software console (here Lotus Notes admin console). I would run a shell script to catch information thru this admin console , in other words : 1 i run my shell script 2 in this script run the admin console 3 get the new... (10 Replies)
Discussion started by: Nicol
10 Replies

2. UNIX for Dummies Questions & Answers

How to catch the rscyn errors?

Hi, In my code, I am running rsync, if any error comes, I have to wirte the error to temp file and I want to send this temp file content to specified email address, I am getting starnge outpout, can you pls help to solve this? My code is: tempfile=error.`date '+%m%d%Y_%H%M%SGMT'` rsync -az -e... (3 Replies)
Discussion started by: redlotus72
3 Replies

3. UNIX for Dummies Questions & Answers

How to catch the exception

Dear friends, I am transferring some files to a windows system from Unix m/c thru FTP Script given below. echo "open $host quote USER $userid quote PASS $pwd $verbose $type cd $dir bin put $file close quit"|$ftp... (0 Replies)
Discussion started by: Vijayakumarpc
0 Replies

4. Shell Programming and Scripting

How to catch the exception on SFTP?

I just want to send files to remote machine via SFTP, my question is: how can I catch the exception when SFTP command error occur? for example: add a log when network interrupt on SFTP put(or failure on rename the remote file etc.). the shell run on linux. (2 Replies)
Discussion started by: younggun
2 Replies

5. UNIX for Dummies Questions & Answers

catch unzip errors

Hi everybody, I'm new to linux world and I need your help!! I'm using vi to create a .sh script that process files moving them from a directory to another and unzipping a file. I need to catch errors while moving or unzipping files. For move command, I do: mv -f... (2 Replies)
Discussion started by: Laetitia
2 Replies

6. Shell Programming and Scripting

Unable to catch the output after core dump and bus error

I have a weird situation in which the binary dumps core and gives bus error. But before dumping the core and throwing the buss error, it gives some output. unfortunately I can't grep the output before core dump db2bfd -b test.bnd maxSect 15 Bus Error (core dumped) But if I do ... (4 Replies)
Discussion started by: rakeshou
4 Replies

7. Programming

Catch ctrl+d in C

Hello, I am programming some kind of shell in special distribution of Linux. My trouble comes with programming the sort function. It should work the same like in the standard shell. When you terminate input, there's need to put End Of Transmission character, which is CTRL+D. But I am not able to... (2 Replies)
Discussion started by: samciz
2 Replies

8. Programming

help with C try catch

can someone give me an example of try catch in C, everytime i do it under the main, i get some try undeclared error, and dont know how to fix it... (3 Replies)
Discussion started by: omega666
3 Replies

9. Shell Programming and Scripting

catch the output of the URL

Hi all, anybody can help me in this? how to catch the output of the URL in scripting. exmple: if i give the URL: https://www.unix.com/shell-programming-scripting/155750-use-sed.html#post302503291 then output should be in onefile newfile.txt thanks in advance.. (6 Replies)
Discussion started by: rajesh_pola
6 Replies

10. AIX

Catch Zombie Process

Hi All, Anyone have any shell script to capture the zombie process, as according to the support they need the real time zombie PID, they only provide the kdb (0) > p* |grep -i defunct (0) > p * | grep <hex pid> But this is doesn't seem easy to catch the zombie as it is not always... (1 Reply)
Discussion started by: ckwan
1 Replies
UUENCODE(1)						    BSD General Commands Manual 					       UUENCODE(1)

NAME
uudecode, uuencode -- encode/decode a binary file SYNOPSIS
uuencode [-m] [-o output_file] [file] name uudecode [-cips] [file ...] uudecode [-i] -o output_file [file] DESCRIPTION
The uuencode and uudecode utilities are used to transmit binary files over transmission mediums that do not support other than simple ASCII data. The uuencode utility reads file (or by default the standard input) and writes an encoded version to the standard output, or output_file if one has been specified. The encoding uses only printing ASCII characters and includes the mode of the file and the operand name for use by uudecode. The uudecode utility transforms uuencoded files (or by default, the standard input) into the original form. The resulting file is named either name or (depending on options passed to uudecode) output_file and will have the mode of the original file except that setuid and exe- cute bits are not retained. The uudecode utility ignores any leading and trailing lines. The following options are available for uuencode: -m Use the Base64 method of encoding, rather than the traditional uuencode algorithm. -o output_file Output to output_file instead of standard output. The following options are available for uudecode: -c Decode more than one uuencode'd file from file if possible. -i Do not overwrite files. -o output_file Output to output_file instead of any pathname contained in the input data. -p Decode file and write output to standard output. -s Do not strip output pathname to base filename. By default uudecode deletes any prefix ending with the last slash '/' for security purpose. EXAMPLES
The following example packages up a source tree, compresses it, uuencodes it and mails it to a user on another system. When uudecode is run on the target system, the file ``src_tree.tar.Z'' will be created which may then be uncompressed and extracted into the original tree. tar cf - src_tree | compress | uuencode src_tree.tar.Z | mail sys1!sys2!user The following example unpack all uuencode'd files from your mailbox into your current working directory. uudecode -c < $MAIL The following example extract a compress'ed tar archive from your mailbox uudecode -o /dev/stdout < $MAIL | zcat | tar xfv - LEGACY DESCRIPTION
In legacy operation, uudecode masks file modes with 0666, preventing the creation of executable files. uudecode cannot change the mode of a created file which is not owned by the current user (unless that user is root). In legacy operation, fchmod(2) allows the mode to be changed. For more information about legacy mode, see compat(5). SEE ALSO
basename(1), compress(1), mail(1), uucp(1), fchmod(2), uuencode(5) BUGS
Files encoded using the traditional algorithm are expanded by 35% (3 bytes become 4, plus control information). HISTORY
The uudecode and uuencode utilities appeared in 4.0BSD. BSD
January 27, 2002 BSD
All times are GMT -4. The time now is 08:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy