Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to compare to values returned from sql in shell scripting? Post 302803565 by vidyadhar85 on Tuesday 7th of May 2013 04:56:09 AM
Old 05-07-2013
check your if loop...
let us know the output of val and value.. Is it strig or numeric? looking at it i guess its numeric.. use -eq instead of ==

Code:
 
if [ $val == $value ] ; then

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sql with shell scripting

Hi, I want to extract data from database table to a flat file using shell scripting. For loading data from file to a table, I had used SQL Loader. How can I do the vice versa using shell scripting. Thanks in advance (3 Replies)
Discussion started by: sendhil
3 Replies

2. Shell Programming and Scripting

Shell scripting and SQL

Hi, I have a file that has contents like this: SQL> select * from details; NAME REG -------------------- ---------- Mani 1 Santosh 2 Manju 3 Mukesh 4 SQL> spool off; ... (5 Replies)
Discussion started by: sendhilmani123
5 Replies

3. UNIX for Dummies Questions & Answers

Aggregate values in a file & compare with sql output

Hi, I have a file containing the following data: junk123junk723itemcode001qty01price10total10junkjunk junk123junk723itemcode002qty02price10total20junkjunk .. .. .. could be 5000+ lines I have an algo and need a code to implement this: 1. Linecount = wc -l (should give 5000) 2. For i... (1 Reply)
Discussion started by: shiroh_1982
1 Replies

4. Shell Programming and Scripting

how towrite sql in shell scripting

hi iam new of scipiting.give me the some Material of regarding sql in scripting. and i have no backup's in 3 severs.how to write script in dirctory. please give me some usefull information cheers Naveen.g (2 Replies)
Discussion started by: naveeng.81
2 Replies

5. Shell Programming and Scripting

passing values from sql to shell script

Hi guyz, Posting a thread after a long time. I want to pass two variables to unix shell script from sql script. Note: I am calling sql script from unix script. sql script has 2 variables one is the return code for status of program run and second one email flag. I don't know how to capture... (3 Replies)
Discussion started by: sachin.gangadha
3 Replies

6. Shell Programming and Scripting

Sql & Shell scripting book

Hi, I am looking for some books that have examples of both Oracle SQL and Shell script being used together. For example, to insert 500 rows into a table using a script. I already have books that cover Shell scripting or SQL, but as separate subjects. I am looking for books that have both of... (3 Replies)
Discussion started by: handle123
3 Replies

7. Shell Programming and Scripting

SQL commands in a shell scripting

Hi, I need to write a shell script file that does 1)Connects to DB using SQL plus 2)Do some SQL query like select * from.... 3)Based on the output that I got from the sql query I will have to write a if else loop. Plz let me know how to write the shell scripting for this. Thanks for... (1 Reply)
Discussion started by: villain41
1 Replies

8. Shell Programming and Scripting

Sql issue in shell scripting

HI friends , i am also facing an issue in mysql i ma trying to insert detail in a variable but not got success #!/bin/sh mysql -u<username> -p<password> <dbname> << EOF DEV=`mysql --skip-column-names <dbname> -e "SELECT timestamp from process_record where id = 1"` EOF echo $DEV ERROR... (3 Replies)
Discussion started by: sanjay833i
3 Replies

9. Shell Programming and Scripting

Shell Scripting question with SQL

hey i have to connect to sql through shell script , then store the value of the query in a variable and then compare it after some time after running a process. i have used this code but it is not working. #!/bin/sh Val = (sqlplus -s rte/rted2@rel76d2 <<! SELECT MAX(STAT_ID) FROM CVT_STATS;... (3 Replies)
Discussion started by: ramsavi
3 Replies

10. Shell Programming and Scripting

Generate sql statement using shell scripting

Can anyone please assist me? I have attached 2 input files and one output file. I need to generate the sql update statements using the above 2 input files. if inputfile2 has 5 rows, then we should generate 5 update statements because column1 is unique. inputfile1 and inputfile2 may contain more... (10 Replies)
Discussion started by: vinus
10 Replies
DRUSH(1)						      General Commands Manual							  DRUSH(1)

NAME
drush - shell scripting interface for Drupal SYNOPSIS
drush [options] command... DESCRIPTION
drush is a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt. Drush core ships with lots of useful commands for interacting with code like modules/themes/profiles. Similarly, it runs update.php, exe- cutes sql queries and DB migrations, and misc utilities like run cron or clear cache. OPTIONS
-r path, --root=path Drupal root directory to use (default: current directory) -l uri, --uri=uri URI of the drupal site to use (only needed in multisite environments) -v, --verbose Display extra information about the command. -q, --quiet Hide all output -d, --debug Display even more information, including internal messages. -y, --yes Assume 'yes' as answer to all prompts -s, --simulate Simulate all relevant actions (don't actually change the system) -p, --pipe Emit a compact representation of the command for scripting. -h, --help A detailed help system, use drush help help for complete help. --version Show drush version. If you get tired of typing options all the time, you can add them to your drush.php alias or create a drushrc.php file. These provide addi- tional options for your drush call. They provide great flexibility for a multi-site installation, for example. See example.drushrc.php. COMMANDS
Drush is all based around "commands" that are usually defined in various modules. help Print the help message. Use --filter to limit command list to one command file (e.g. --filter=pm). cache-clear (cc) Clear a specific cache, or all drupal caches. core-cli (cli) Enter a new shell optimized for Drush use. core-cron (cron) Run all cron hooks. core-status (st) Provides a birds-eye view of the current Drupal installation, if any. php-eval (eval) Evaluate arbitrary php code after bootstrapping Drupal. updatedb (updb) Apply any database updates required (as with running update.php). variable-get (vget) Get a list of some or all site variables and values variable-set (vset) Set a variable. watchdog show Shows recent watchdog log messages. Optionally filter for a specific type. pm-enable (en) Enable one or more extensions (modules or themes). pm-disable (dis) Disable one or more extensions (modules or themes). pm-download (dl) Download projects from drupal.org or other sources. pm-uninstall Uninstall one or more modules. pm-updatecode (upc) Update Drupal core and contrib projects to latest recommended releases. pm-update (up) Update Drupal core and contrib projects and apply any pending database updates (Same as pm-updatecode + updatedb). sql-cli (sqlc) Open a SQL command-line interface using Drupal's credentials. sql-connect A string for connecting to the DB. sql-dump Exports the Drupal DB as SQL using mysqldump. This manual only lists a few of the most frequently used builtin commands shipped with the Drush core, since other Drupal modules and third-party "command files" may extend this list significantly. The canonical source of information for the available commands and their usage is the online help system. More information on each command is also available through drush help <command>. Most commands have shortcuts indicated in parenthesis. FILES
/etc/drush/drushrc.php /usr/share/doc/drush/examples/example.drushrc.php SEE ALSO
cvs(1), svn(1), wget(1). AUTHOR
Drush was originally developed by Arto for Drupal 4.7 (this alpha code can still be found in the DRUPAL-4-7 branch). In May 2007, it was partly rewritten and redesigned for Drupal 5 by frando. Since 2008, the module has been maintained by Moshe Weitzman, Owen Barton and Adrian Rossouw. This manual page was written by Antoine Beaupre <anarcat@debian.org> in June 2009 for the Debian project (but may be used by others). January 11, 2011 DRUSH(1)
All times are GMT -4. The time now is 09:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy