Is there any command in windows batch file similar to the unix grep command

Hi,
I have a batch file which will return status of the Database to a file ex: "OPEN". Now I want to read this output file and check for the "OPEN" string from another batch file. any suggestions?. This is similar to "grep" command in unix. I want this to be done in windows batch file.
This is my actual batch file
rem -- Description: Check whether the Database is UP
rem -- Usage:
rem -- ORACLE_SID is input parameter for the file
rem --
rem --start of batch file
@echo off
set ORACLE_SID=%1
echo connect plp/ltd1plp@%1
echo set cmdsep on
echo set cmdsep '"'; --"
echo set term on
echo spool c:/status_log.log
echo select status from v$instance;
echo spool off
) | sqlplus /nolog
rem --end batch file
Thanks.

The same link from [google cache|http://209.85.229.132/search?q=cache:EJrm9tgj0a8J:www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/find.mspx+windows+find&cd=1&hl=en&ct=clnk&client=opera]. Also you can use help:
find /?

Similar Messages

  • I sent iTunes to trash. I was able to recover the program but have to "put back" songs one at a time. Is there any way to put back from trash using the "select all" command?

    I sent iTues to trash by mistake (trying to delete files from "yesterday"). I got the program back but have to "put back" songs one at a time. Is there a way to put back multiple songs using the "select all" command or anything else? Thanks for the help.

    The prgram is in one location and the library (media + library files) are in another. Sending it all to the trash would take some pretty delibrate multiple actions and digging through multiple folders, so I don't know how this was managed unless there's something in Snow Leopard that's new. Occasionally I have moved a file to the trash in Finder that I didn't want to and I can use Finder's "undo" to undo the last move. With many files...?

  • Are there any "execute once" buttons in labview?? (the likes of command buttons in VB)

    In VB, a button can be able to exucute a task or command once when pressed, in other words, we can NOT hold down this button as in the following case:
    Command1_Click()
    text3 = text1 + text2
    Note,that if the form is still running and yo add new numbers to text1 and text2, text3 isn't updated unless Command button is pressed once again.
    Unfortunately in LabVIEW, the only buttons I know are boolean, they seem to be held down when pressed or latched, sothat  when new numbers are inserted in the numeric controls, and mouse is pressed anywhere on the front panel (when vi runs) the indicator is automatically updated.
    So is there any execute once buttons??
    T. A.
    Solved!
    Go to Solution.

    Well the VB code you post is a Event Triggered code, you can use the same in LabVIEW with the event structure.
    The concatenation of strings can be put inside the event case and will only execute when the button is pressed.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Is there any MBean that returns war file details of the current page/contex

    Hi,
    We are building some diagnostic tests which would run as MBeans, both config and runtime. These MBeans would be invoked when an incident/error occurred on a page. One of my diagnostic test is to "get the details of the war file, like war file name, file path etc..from the current web page/current context root... and then inspect for some entries in the configuration files inside that war file".
    Is there any weblogic MBean that gives me the details of the war file from the current web page / current context root?
    Appreciate your help.
    Thanks,
    Eshwar.
    Edited by: Eshwar Mekala on May 5, 2010 6:30 PM
    Edited by: Eshwar Mekala on May 10, 2010 3:52 PM

    There is information about the applications on the server via the ApplicationRuntimeMBean. I believe there is context root information for the app inside the ComponentRuntimeMBeans. So you could query the app runtime mbeans to find the matching the ApplicationRuntimeMBean. Then use that to find the matching AppDeploymentMBean which has the file location.
    There might also be something in the servlet API - I would ask in the webapp forum.

  • Call Oracle Stored Procedure with Parameters from Windows Batch File

    Hi,
    I have an oracle procedure that requires two parameters to execute, start date and end date as such:
    CREATE OR REPLACE PROCEDURE insert_orders(
    pSTART_DT IN varchar2
    , pEND_DT IN varchar2
    I want to create a windows batch file to execute the procedure but want to be able to specify the parameters (ie start and end dates) in the batch file as opposed to changing the sql file that the batch file uses to execute the procedure but I don't know what the syntax is. I tried the following but it still doesn't work.
    Sql File: call_insert_orders.sql
    execute insert_orders('&1','&2');
    exit
    Batch File:
    sqlplus username/password @call_insert_orders.sql %01-jan-2010% %01-jan-2011%
    When I execute the batch file, my DOS window still prompts me to enter value 1 so I think it recognizes that there is a variable being used but is not able to fill in the actual value I specify. I'm not an experienced DOS/Windows Batch File person so I'm guessing it's my syntax that's screwed up. There is not a lot of documentation on this subject matter hence my post on this forum. Any helps would be appreciated.
    Thanks

    Hello,
    Just try the same DOS command without all the % sign.
    In MS-DOS, the % at the beginning and at the end of a string are for variables. Which means your batch is looking for a variable called 01-jan-2010 and a variable called 01-jan-2011, but those are the values you want to pass, not the name of variables.
    As they are not defined, nothing is passed to the sqlplus script, and that is why you are prompted for values.
    Hope it will help.
    Regards,
    Sylvie

  • Maxl within Windows Batch File

    Hello,
       I am trying to schedule an Automatic Essbase Archiving command . Function is to Disable connects , Archive , Unarchive and Enable connects . I know the Maxl commands which perform this action but just wanted to make sure how to portray this within a Windows Batch file.
    Within the Batch file , abc.bat can I insert those commands . To enter the shell we need essmsh command , but I didnt wanted to get into decrypting , encrypting the ID etc to do that . So is there a way to get it done within the Windows batch file ?
    Thanks !!

    Yes its Straight forward case ,create a batch file which call the maxl script.The batch file should contain the user id and password of Essbase and the maxl script should contain the parameters of Essbase archiving
    The content of batch file for Essbase archiving process
    echo off
    set ESSUSER=admin
    Set ESSPWD=Password
    set ESSSERVER=localhost
    set ESSAPP=Sample
    set ESSDB=Basic
    SET ESSBASE SERVER PATH=D:\Hyperion\Middleware\EPMSystem11R1\products\Essbase\EssbaseServer
    set MaxlScript=D:\Hyperion\Middleware\user_projects\epmsystem1\Essbaseserver\essbaseserver1\bin
    essmsh "D:\Archieve.mxl" %ESSUSER% %ESSPWD% %ESSSERVER%
    ===================================================================================================
    Maxlscript Content for Archieving
    spool on to "D:/bck.log";
    set timestamp on;
    login $ESSUSER $ESSPWD on $ESSSERVER;
    display session all;
    alter system kill request all;
    alter system logout session all force;
    export database $essApp.$essDB all data to server data_file 'd:\alldata.txt';
    alter database $essApp.$essDB force archive to file "D:/sample.arc";
    alter database $essApp.$essDB end archive;
    spool off;
    logout;
    exit;
    Similarly can you create batch files for Cube restoration .I hope the above example helps you
    Thanks,
    Sreekumar Hariharan

  • HT4407 Is there any way to download these files manually from another source? The download from boot camp keeps stopping at around 25% and then produces the error "Can't download Windows Support Software because of a network problem". Thx!

    Is there any way to download these files manually from another source? The download from boot camp keeps stopping at around 25% and then produces the error "Can't download Windows Support Software because of a network problem". Thx!

    No. This issue is dicussed here frequently. The only option is to be patient and try often. Search this forum for other posts about this issue.

  • Is there any way to play all files in a directory by one url?

    Hi all,
    I am testing fms this days, I have put all my files(such as 1.mp3,2.mp3...n.mp3) in my directory.
    I can play single file fine with url like this:
    rtmp://localhost/mp3/mp3:x/2
    but i want to know is there any way to play all files in my direcotry?
    for example, user click the play button, the player(smp) automatic plays all files in the directory, link windows media server.
    Should I use playlist? Or there is another better way?
    Thanks a lot.

    Hi,
    FMS do not directly take a directory to play files, the file names have to be fetched some way (through script if needed) to make a playlist and then the play command needs to be repeated as many times.
    Thank you !

  • Is it possible to call a windows batch file from PL/SQL

    Hi gurus,
    Would require your help.Is it possible to call a windows batch file from PL/SQL??If yes can you give an example for the same or any workaround for the same.
    Regards
    Vijay

    Hi!
    Youn need some extproc related entries in you listener.ora and tnsnames.ora file.
    *1. In the listener.ora:*
    Defining the listener process is done in two parts.
    The information contained in each listener differs!!!
    The first part is as follows:
    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = IPC)(KEY = extproc))  <---  *ADD THIS LINE
          (ADDRESS = (PROTOCOL = TCP)(HOST = yourhostname)(PORT = 1521))
      )The seoncd part is as follows:
    SID_LIST_LISTENER =
      (SID_LIST = 
        (SID_DESC =
          (GLOBAL_DBNAME = YOUR_GLOBAL_DBNAME)
          (ORACLE_HOME = c:\oracle\product\10.2.0)  <-- THIS IS YOUR ORACLE_HOME
          (SID_NAME = YOUR_SID)                            <-- SID
        (SID_DESC =                                              <--- ADD THIS LINE
          (SID_NAME = PLSExtProc)                          <--- ADD THIS LINE
          (ORACLE_HOME = c:\oracle\product\10.2.0) <--- ADD THIS LINE AND EDIT TO YOUR ORACLE_HOME
          (PROGRAM = extproc)                                <--- ADD THIS LINE
          (ENV = "EXTPROC_DLLS=ANY")                  <--- ADD THIS LINE
        )                                                                <--- ADD THIS LINE
      )*2. In the tnsnames.ora you need to add the following entry:*
    *(The KEY value entered must be match to the KEY value entered int the listener.ora file!)*
    EXTPROC_CONNECTION_DATA =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(KEY = extproc))
        (CONNECT_DATA =
          (SID = PLSExtProc)
          (PRESENTATION = RO)
      )Finally you need to restart your listiner. After restarting there will be a service called "PLSExtProc" in your listener.
    This are only examples for extproc configuration, your tnsnames.ora and listener.ora can be differs.
    FIRST MAKE MAKE A BACKUP OF YOUR ORIGINAL tnsnames.ora AND listener.ora FILES
    For more information please check metalink note 68061.1 "EXTPROC: Creating External Procedures on Windows NT"
    Bestr Regards
    Norbert

  • Executing batch files from websevice using ODI OS Command

    Hi,
    Is it possible to execute the batch files using odi os command from webservices.
    We have developed a webservice, which passess some parameters to one batch file and after that we executing the same batch file in package using odi os command. In opeartor is showing as running, it never ends.
    But if we run the same package from designer, it is executing successfully. Also the same web service is working fine for executing non batch scenarios.
    what could be the problem??
    We got one possible reason for failure...
    For executing the batch from web services, we need read and executable permissions on the drive where batch sits.
    We are logging into ODI using SUPERVISOR. How to give the permissions to SUPERVISOR as we are having windows authentication.
    Edited by: Naveen Suram on Dec 17, 2009 8:07 PM
    As a work around, can we use ODIOSCommand instead of OS Command. But it is asking for starting event? Whether both the commands does the same functionality??
    Edited by: Naveen Suram on Dec 17, 2009 9:08 PM

    From the FAQ:
    2. How do you launch an external program on a Microsoft Windows platform from a program developed on the Java [tm] programming language?
    The following will launch notepad in Microsoft Windows NT:
    Runtime.getRuntime().exec("cmd /c notepad.exe");
    To launch a program in Microsoft Windows 95/98 use:
    Runtime.getRuntime().exec("c:\\windows\\notepad.exe");
    The Runtime class allows interaction between a program and its environment. The first string command instructs the command line interpretor, cmd to open up the calculator application.
    The exec() methods do not use a shell; any arguments must have the full pathname to the shell as well as the command itself.
    For example, to run a shell on the UNIX� platform, type:
    Runtime rt = Runtime.getRuntime();
    Process p = rt.exec("/usr/bin/sh -c date");
    To run a batch file under Microsoft Windows 95/98:
    Process p = rt.exec("command.com /c c:\\mydir\\myfile.bat");
    To run a batch file under Microsoft Windows NT:
    Process p = rt.exec("cmd /c c:\\mydir\\myfile.bat");
    where 'cmd' and 'command.com' are the command-line interpreters for Microsoft Windows machines.
    The Runtime.exec() methods might not work effectively for some processes on certain platforms. Special care should be taken with native windowing, daemon, WIN16/DOS process or some shell scripts.
    regards,
    jarshe

  • Is there any way to create a file compatible with Premiere Pro

    Is there any way to create a file in Premiere elements that is compatible with Premiere Pro and that can be used in Premiere Pro

    Consternation
    The important information that I do not see mentioned nor offered by you.
    1.What version of Premiere Elements are you using and on what computer operating system it is running? What version of Premiere Pro do you want to use?
    The Premiere Pro Import Supported Formats seem to indicate that it will accept the Premiere Elements project.prel (project file) on Windows Only.
    Adobe Premiere Pro Help | Supported file formats
    This may or may not be possible depending on damaged projects or outdated elements.
    2. If you want to export your Premiere Elements Timeline to a file saved to the computer hard drive and subsequently import that into your Premiere Pro version, that "should" work. You would go to the Premiere Elements Publish+Share/Computer/ and make a selection based on what the Premiere Pro Import Supported file formats are and what you need. I can help you with that. But, details first.
    But, just a "beware"...when you get to Premiere Elements 11 or 12 (if that is the version involved) Publish+Share/Computer/ there are several categories, but all you see is Adobe Flash Video, MPEG, and AVCHD. The rest of the list that includes AVI and QuickTime which both need to be scrolled to all of the time to see them, not just sometimes, with the thin scroll bar to the right of the list of choices. You can export files
    with AVI file extension, under Publish+Share/Computer/AVI
    with MOV file extension, under Publish + Share/Computer/QuickTime
    And, if you do not have QuickTime installed on your computer with Premiere Elements, you are not going to have presets for the QuickTime export.
    Remember, there is more to an export than just its file extension. Know your other export properties as well.
    In many cases, you can customize the export settings to suit your requirements.
    Problems will exist if you are trying to go from Premiere Elements Windows to Premiere Pro Mac or vice versa.
    I would be glad for the opportunity to help you with this issue, but details are needed.
    Looking forward to your follow up.
    Thanks.
    ATR

  • SCF /SCANNOW - is there any option to exclude some files for the scan?

    Hi,
    please let me know is there any option to exclude some files in SCF /SCANNOW command?
    Appreciate your help!
    Regards,
    Prabu

    Prabu,
    Did your question answered? How is the current situation? Have you tried to replace that file manually successfully?
    Please give us a reply in order to know if you need further help. 
    Karen Hu
    TechNet Community Support

  • How do I write a command in a .batch file written in NOTEPAD to run a powershell command?

    How do I write a command in a .batch file written in NOTEPAD to run a powershell command?
    Example:
    powershell -Command "& {Update-Help;}"
    would this be a correct command to put in a .batch file to update help information in powershell.
    All I want to know is how to write a windows powershell command in a .batch file.
    Multi-Commands
    Single-Commands
    Charles Wright

    Hi,
    You can separate multiple commands with a semicolon (;).
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Is it possible to call a windows batch file from PL/SQL block ??

    Hi gurus,
    Would require your help.Is it possible to call a windows batch file from PL/SQL block ??If yes can you give an example for the same or any workaround for the same.
    Regards
    Vijay

    You didn't specify a database version, but if you are 10g or higher, it's quite straightforward using an external job type in DBMS_SCHEDULER. Funnily enough i'm looking at something similar myself at the moment.
    Useful guide to some of the issues here Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files

  • Problem in connecting to sqlplus from windows batch file (DOS)

    Hi All,
    We have a new 10g Oracle database installed on windows server. I am trying to write a windows batch file to
    1) Connect to SQLPLUS
    2) Execute a script
    3) Disconnect from SQLPLUS.
    Example File Name:- execsql.bat
    SET ORACLE_SID=CAUT
    SET SCHEMA_IN=%1
    SET PASS=DEV
    SET script=%2
    sqlplus %SCHEMA_IN%/%PASS%@%ORACLE_SID% @%script%
    if %errorlevel% NEQ 0 echo ERROR: %ERRORLEVEL% else echo OK
    Now if i run this bat file like :- execsql.bat DEV script1.sql
    DEV= schema name,
    script1.sql = this file contains select * from dual;
    The code runs fine, but if i change dual to dual1 the sql error's out but not able to catch the error in the batch file.
    Reason why i would like to catch the error is this batch file would be scheduled through Autosys job scheduler and for autosys any exit code >0 is an error. Please help me in rewriting this batch script.
    Thanks
    Sam.

    Hello,
    What if you run this in SQL*Plus before you run the SELECT:
    whenever sqlerror exit failure

Maybe you are looking for

  • How to limit  dimensions values of querybuilder

    Hi, I want to learn how to limit dimension value in query builder. i want, the user who run the querybuilder can not see a dimension value which i do not want to display. For example, The time dimension has "2000" and "2001" values as default which i

  • Nokia asha 210 the phone is not supported by nokia...

    i think my phones software is not orignl software because i see product on the body and i see product code but the product code is not same so plz tell me what i do....? because i flashed my phone from a local shop Moderator's note: Post was edited b

  • Using disk utility to burn new image dvd's

    Ok I just learned to burn DVD'd using Disk Utility and New image. But I have come to halt in my burning with a new issue. My issue is that I have a file that is 4.63GB. When I make a new image so that I can burn it, it increases the size of the file(

  • Fix for Top Rated Playlist...On the iPod?-\

    Hello- Love the iPod....great place for all of my music...LOVE IT! I miss a feature that was either forgotten or taken out when the update came for allowing podcasts on our iPods with Color Screens...the ability to rate songs on your iPod and then ha

  • Photos look different on distilled pdf than photoshop edit

    I have a customer who prints her tabloid with us> Yesterday she sent a couple screen shots to show me the difference in her black and white photos that she edits in photoshop compared to that edited pic on the finished pdf which she then sends to me.