Sponsored Content
Full Discussion: Exception Handling
Top Forums Shell Programming and Scripting Exception Handling Post 302118835 by bertpereira on Thursday 24th of May 2007 12:32:04 PM
Old 05-24-2007
Network Exception Handling

Hi,

I have written a script to load csv files into a mysql database, however, i would like for the shell script to exit in the event of an error (missing file, load error etc.) - currently if an error is encountered the next statement is processed - This is how i am loading the csv scripts

export id=root
export db=testcsv
export db_add=localhost

mysql -h$db_add -u$id -D$db <loadA.sql

Thanks in advance

Bert
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

exception handling

Does exception handling exist in any UNIX enviornment? I develop on Windows MSVC++ land and need to port to UNIX. (1 Reply)
Discussion started by: RichardS
1 Replies

2. Programming

Linux g++ 2.95.3 exception handling

Anybody happen to be familiar with any deficiencies with g++ 2.95.3 regarding exception handling, specifically in multi-threaded / multi-module (shared library) based applications? I'm seeing behavior where thrown exceptions are not caught, but basically ignored causing the application to... (0 Replies)
Discussion started by: earl
0 Replies

3. Shell Programming and Scripting

Exception-handling in Shell programs

Hi all, I am writing a set of scripts and some of these are nested within others. I want to be able to execute a single high-level script at the command-line, which in turn may invoke other scripts as required, and when a failure occurs in any of the nested scripts, I want to be able to track... (2 Replies)
Discussion started by: chaitu_inmage
2 Replies

4. Linux

Handling "command not found" exception

hello friends, I am given a project to handle the command not found exception.I am using RED HAT 9. Generally, when we press a wrong command in the terminal: example :- " $cet " in place of " $cat ". Then we get this exception. But I need to give the output as the combinations that are possible... (5 Replies)
Discussion started by: nsharath
5 Replies

5. Programming

Advanced Exception Handling in C++

Hi Friend, Could you please provide me with some tutorial for Advanced Exception handling in C++, mainly set_terminate() and set_unexpected() functions? Please find the details below: OS: Unix Compiler: gcc. Thanks. :) Awesome001 (0 Replies)
Discussion started by: awesome001
0 Replies

6. Shell Programming and Scripting

Exception handling

Sometimes when I try to use curl to upload to an ftp server, I get the message: $curl -T file.wmv ftp.eu.filesonic.com --user user:password curl: (8) Got a 421 ftp-server response when 220 was expected How do I get the script to try again if I get the message curl: (8)? (2 Replies)
Discussion started by: locoroco
2 Replies

7. Programming

Exception Handling C++

Hello All, I have a question ....which I am totally confused about! If I have a fxn foo in a program which returns a logical value. But it has a posssiblity to throw some exception. Now my exception handler returns a value as a string stating why the exception occured. But my... (1 Reply)
Discussion started by: mind@work
1 Replies

8. Solaris

solaris 7 exception

Hi all, An application works well under 2.6 but under 7 it gives TEXT_IO exceptions. (Is_Open, Check_Is_Open, Get_Line procedures). Any idea? Regards (3 Replies)
Discussion started by: endoavour
3 Replies

9. Shell Programming and Scripting

Monitor logs for exception and if exception come then sent an email

Hi Folks, please advise , I have logs generated on unix machine at location /ops/opt/aaa/bvg.log , now sometimes there come exception in these logs also, so I want to write such a script such that it should continuously monitor these logs and whenever any exception comes that is it try to find... (3 Replies)
Discussion started by: tuntun27272727
3 Replies
MYSQLUSERCLONE(1)						  MySQL Utilities						 MYSQLUSERCLONE(1)

NAME
mysqluserclone - Copy a MySQL user to one or more new users on another server SYNOPSIS
mysqluserclone [options] base_user new_user[:password][@host_name] ... DESCRIPTION
This utility uses an existing MySQL user account on one server as a template, and clones it to create one or more new user accounts with the same privileges as the original user. The new users can be created on the original server or a different server. To list users for a server, specify the --list option. This prints a list of the users on the source (no destination is needed). To con- trol how to display list output, use one of the following values with the --format option: grid (default) Display output in grid or table format like that of the mysql monitor. csv Display output in comma-separated values format. tab Display output in tab-separated format. vertical Display output in single-column format like that of the G command for the mysql monitor. OPTIONS
mysqluserclone accepts the following command-line options: --help Display a help message and exit. --destination=<destination> Connection information for the destination server in <user>[:<passwd>]@<host>[:<port>][:<socket>] format. --dump, -d Display the GRANT statements to create the account rather than executing them. In this case, the utility does not connect to the destination server and no --destination option is needed. --format=<list_format>, -f<list_format> Specify the user display format. Permitted format values are grid, csv, tab, and vertical. The default is grid. This option is valid only if --list is given. --force Drop the new user account if it exists before creating the new account. Without this option, it is an error to try to create an account that already exists. --include-global-privileges Include privileges that match base_user@% as well as base_user@host. --list List all users on the source server. With this option, a destination server need not be specified. --quiet, -q Turn off all messages for quiet execution. --source=<source> Connection information for the source server in <user>[:<passwd>]@<host>[:<port>][:<socket>] format. --verbose, -v Specify how much information to display. Use this option multiple times to increase the amount of information. For example, -v = verbose, -vv = more verbose, -vvv = debug. --version Display version information and exit. NOTES
You must provide connection parameters (user, host, password, and so forth) for an account that has the appropriate privileges to access all objects in the operation. The account used to connect to the source server must have privileges to read the mysql database. The account used to connect to the destination server must have privileges to execute CREATE USER (and DROP USER if the --force option is given), and privileges to execute GRANT for all privileges to be granted to the new accounts. For the --format option, the permitted values are not case sensitive. In addition, values may be specified as any unambiguous prefix of a valid value. For example, --format=g specifies the grid format. An error occurs if a prefix matches more than one valid value. EXAMPLES
To clone joe as sam and sally with passwords and logging in as root on the local machine, use this command: $ mysqluserclone --source=root@localhost --destination=root@localhost joe@localhost sam:secret1@localhost sally:secret2@localhost # Source on localhost: ... connected. # Destination on localhost: ... connected. # Cloning 2 users... # Cloning joe@localhost to user sam:secret1@localhost # Cloning joe@localhost to user sally:secret2@localhost # ...done. The following command shows all users on the local server in the most verbose output in CSV format: $ mysqluserclone --source=root@localhost --list --format=csv -vvv # Source on localhost: ... connected. user,host,database joe,localhost,util_test rpl,localhost, sally,localhost,util_test sam,localhost,util_test joe,user,util_test COPYRIGHT
Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA AUTHOR
MySQL Utilities Team COPYRIGHT
2010, Oracle and/or its affiliates. All rights reserved. 1.0.3 May 09, 2012 MYSQLUSERCLONE(1)
All times are GMT -4. The time now is 08:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy