Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-14-2011, 07:07 AM   #1
LQ Newbie
Registered: Apr 2011
Posts: 1

Rep: Reputation: 0
Unhappy Convert few lines of SHELL script to DOS batch

I really need help with this part of a shell script which I am trying to migrate to DOS batch script. Please help.

/usr/bin/sed 's/\\\\/\\/g' /nesto/$FILENAME1 > /nesto/$FILENAME2
/usr/bin/sed 's/\\\|/\|/g' /nesto/$FILENAME2 > /nesto/$FILENAME1
/usr/bin/sed 's/*|//g' /nesto/$FILENAME1 > /nesto/$FILENAME
/usr/bin/find /nesto/ -size 0 -exec rm {} \;
Old 04-14-2011, 09:00 AM   #2
Registered: Jan 2005
Location: Nice, France
Distribution: Ubuntu,RHES, Mandriva, RHAS, AIX 4.3.3, 5.2 & 5.3, Debian,Solaris8/10
Posts: 119

Rep: Reputation: 20
hmm seems compromise as sed is not native on win32 environment.
Have a try to port cygwin on win32 either.
Old 04-14-2011, 09:20 AM   #3
Registered: Mar 2009
Location: Rotterdam, the Netherlands
Distribution: Slackwarelinux
Posts: 695

Rep: Reputation: 110Reputation: 110
or msys/mingw (latter being "minimal gnu for windows")
find and sed don't have any (native) equivalents in a typical win32/win64/dos environment
Old 04-14-2011, 05:14 PM   #4
Registered: Nov 2005
Location: East Coast, USA
Distribution: Fedora 18, Slackware64 13.37, Windows 7/8
Posts: 362

Rep: Reputation: 40
Originally Posted by Ramurd View Post
find and sed don't have any (native) equivalents in a typical win32/win64/dos environment
DOS batch scripting is, and has been, obsolete since Windows 2000 shipped the Windows Script Host COM objects. And WSH is quickly becoming obsolete with the release of PowerShell (V2). Using windows Powershell you have unfettered access to the .NET CLR to use in your shell scripts but this can be quite challenging for non-programmers to understand. If you are a programmer then take a look at the System.String.Replace() and System.Text.RegularExpressions.RegEx.Replace() methods which can closely mimic the Unix steam editor.
0 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Shell script to convert values on successive lines into consecutive ranges? kmkocot Programming 5 07-09-2010 11:59 AM
[SOLVED] Convert DOS bat file to shell script spiderdog Linux - Newbie 2 06-21-2010 03:54 PM
Need to convert a batch file to a shell script webshore Linux - Newbie 2 05-03-2010 08:42 AM
Making a batch shell script to convert, merge and append (join) movie's to mkv mnt_schred Programming 8 12-07-2009 12:51 PM
need a bash script to batch convert .wav to .mp3 nass Slackware 15 06-23-2007 02:00 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:36 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration