Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: batch file scripting

Re: batch file scripting

From: Steve Perry <sperry_at_sprynet.com>
Date: Wed, 19 Jul 2006 21:10:04 -0500
Message-Id: <05B00F26-0CE8-41A3-A5BA-D5D489D84791@sprynet.com>


that only takes 2 lines :)))

C:\>set f=myfile_%date:~10,4%-%date:~4,2%-%date:~7,2% C:\>echo %f%
myfile_2006-07-19

seriously though.

Jared, and others, have already mentioned using perl and cygwin. Perl works great between linux and windonts. I use the same script to monitor the alertlog on windows and linux. if you really want to use a batch script, download the win32 unix ports of grep, sed, awk, cat, wc, tail, tee.... I have a lot of them and used to write some interesting scripts. They were easy to install (i.e. copy ) and eased the pain of cli. the downside is they're only "duct tape". I don't think they're updated anymore so it buys you some time until the "new guy" takes over your scripts ;)

post or email what you want to translate. This is a great place for help.

my 2¢

On Jul 19, 2006, at 12:21 PM, Jared Still wrote:

> I would be very surprised if such a site/tool existed.
>
> Any shell script of moderate complexity would be
> very difficult to translate to windows batch scripting
> via automated facility.
>
> What can be done with 1 or 2 lines in shell often
> takes many lines of code in windows.
>
> eg. A one liner in shell. Get a filename with a date stamp.
> jkstill-0 > f='myfile_'$(date +%Y-%m-%d)
> jkstill-0 > echo $f
> myfile_2006-07-19
>
> Doing this in Windows requires several lines of vbscript and
> temporary files.
>
> If you really need to run the shell scripts in Windows, consider
> using Cygwin.
>
> Or just rewrite them.
>
>
> On 7/19/06, Joe Smith <joe_dba_at_hotmail.com> wrote:
> Does anybody know of a site that is good for translating unix shell
> scripts
> into Windows batch files? I have two rman scripts that I want to
> run on a
> windows server.
>
> thanks.
>
> _________________________________________________________________
> Don't just search. Find. Check out the new MSN Search!
> http://search.msn.click-url.com/go/onm00200636ave/direct/01/
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>
>
>
> --
> Jared Still
> Certifiable Oracle DBA and Part Time Perl Evangelist

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Jul 19 2006 - 21:10:04 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US