SED Command :: UNIX to Windows


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SED Command :: UNIX to Windows
# 1  
Old 01-28-2010
SED Command :: UNIX to Windows

hello people

Please tell me the Windows equivalent for the SED command used in the UNIX shell scripts. In Unix this command is used to replace a string by another in a file.


Thanks in Advance!
# 2  
Old 01-28-2010
You can install cygwin (Google for it) - it has sed as one of it's packages. You can do much more with sed, as a side note.
A decade ago I remember there was a Windows NT4 Resource Kit which had some Unix tools in it. Not sure if a similar package from Microsoft still exists today.
# 3  
Old 01-28-2010
Quote:
Originally Posted by zaxxon
You can install cygwin (Google for it) - it has sed as one of it's packages. You can do much more with sed, as a side note.
A decade ago I remember there was a Windows NT4 Resource Kit which had some Unix tools in it. Not sure if a similar package from Microsoft still exists today.

hi zaxxon

Thanks mate for your prompt reply and vivid information. But teh case is a bit complictaed man, i cannot install anything from my own as i m wrking on client server. If possible can you please suggest some other remedy for the same.


PS: Actually a batch file is running successfully in UNIX and now that server is retiring. The new server is in Win so i need all this info.
# 4  
Old 01-28-2010
Please state the exact version of M$ Windows and post the piece of unix script.
# 5  
Old 01-28-2010
Quote:
Originally Posted by methyl
Please state the exact version of M$ Windows and post the piece of unix script.
hi methyl
its MS Windows - 2003 Service Pack 1

and here is the string sample:

sed "s/a/A/g" file1 > file2
# 6  
Old 01-28-2010
why dont use cscript (vb)? its default supported on all Windows versions from 2003 if I recall correct
# 7  
Old 01-28-2010
Quote:
Originally Posted by necron
why dont use cscript (vb)? its default supported on all Windows versions from 2003 if I recall correct
hi necron

thanks for your input mate. The thing is that i cannot make this decision nor can suggest. You can say that its a kinda order which i have to follow and create batch files only.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

UNIX command to copy files from Windows to UNIX box

Hi Folks, I have a file name abc.xml in my windows machine at the location c:\ytr\abc.xml which I want to place at the unix box machine inside cde directory.. at the following location that is /opt/app/cde/ now the credentials of unix box are abc345 -->(dummyid) ftyiu88--->(dummy passwd) ... (4 Replies)
Discussion started by: punpun66
4 Replies

2. UNIX Desktop Questions & Answers

Can Unix access Windows' File through Command Prompt in Unix

Hi all, I wish to know whether Unix can access window's file in Unix's terminal? Apart from that, how to copy files or share files between Window and Unix? I get to know of secure copy, however, my company's Unix does not support the feature of secure copy? Any other method for me to share/... (5 Replies)
Discussion started by: jessy83
5 Replies

3. Shell Programming and Scripting

Execute unix command from an html page in windows

i have a problem situation, where i have a html file say click.html. i have a button "ls" in that html page. i run this html file in windows....Now say if i click that "ls" button it must connect to the unix server and execute ls and return the results back to html page in windows. can anyone tell... (8 Replies)
Discussion started by: niteesh_!7
8 Replies

4. UNIX for Dummies Questions & Answers

How do you use UNIX commands in the Windows Command Line?

I tried opening the windows command line and typing UNIX commands, but they don't work. It kept saying that it was not recognized as an internal or external command, operable program or batch file. Removed strange sentence with even stranger link I need to use UNIX commands such as 'less',... (9 Replies)
Discussion started by: vlay2
9 Replies

5. AIX

Running unix command from windows? How?

Hello Folks, I have a need to execute certain scripts on a regular basis on a number of (AIX) servers. What I had in mind, is to accomplish this using ssh/rsh, auto login. Initially I developped the script, which can be invoked from one of the AIX servers (by loggin into the first host), and... (4 Replies)
Discussion started by: haroon_a
4 Replies

6. Shell Programming and Scripting

Windows command shell equivalent in Unix

In Windows we use cmd.exe \c as the command SHell What is its equivalent in UNIX ? Thanx for all your help. (10 Replies)
Discussion started by: simonsimon
10 Replies

7. Shell Programming and Scripting

Running windows command from Unix

Hi, Is there any way to invoke a Windows command from Unix ?? For eg: I want to track down a user executing a script and want to send him a message through net send in windows .. I am able to get the user machines ip ... and since I want my message to be popped up in users screen, wud... (4 Replies)
Discussion started by: Sabari Nath S
4 Replies

8. UNIX for Advanced & Expert Users

Running windows command from Unix

-------------------------------------------------------------------------------- Hi, Is there any way to invoke a Windows command from Unix ?? For eg: I want to track down a user executing a script and want to send him a message through net send in windows .. I am able to get the user... (1 Reply)
Discussion started by: Sabari Nath S
1 Replies

9. Shell Programming and Scripting

Runnig a Windows command from UNIX

Hi, I need to execute a Windows command from UNIX crontab ( or similar utility). We are evaluating the schedular applications that will easily solve this issue although it will be a while by the time the tool selection happens and I need something to implement this solution in the iterim. ... (1 Reply)
Discussion started by: ashpon
1 Replies

10. UNIX for Dummies Questions & Answers

Running a UNIX command from Windows

Hi I need to run a UNIX command from Visual C++ Windows program. I was thinking of the Windows program generating a dummy file on the UNIX drive. On the UNIX box I could have a simple FORTRAN porogram searching continually for this dummy file and executes the UNIX command when the file... (2 Replies)
Discussion started by: robbiegregg
2 Replies
Login or Register to Ask a Question