Logo 
Search:

Unix / Linux / Ubuntu Forum

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds

Migrate unix shell script from Solaris machine into windows machine

  Date: Nov 24    Category: Unix / Linux / Ubuntu    Views: 753
  

I need to migrate unix shell script from Solaris machine into
windows machine.ie i need to write the batch fine under
Windows(DOS) machines.
Here i'm facing a problem at begining itself.
How to read the variable in dos,as we do using
"read <variable-name>" under unix !!!

i need the dos commands for the following unix script..

echo Ënter file name
read FileName
echo $FileName

Share: 

 

6 Answers Found

 
Answer #1    Answered On: Nov 24    

No such thing, I'm afraid.

That's one of the reasons why a Unix shell is so much more powerful than the
DOS command line.

 
Answer #2    Answered On: Nov 24    

echo is a standard dos command. I don't remeber if there is any command
similar to read for dos though. The GnuWin32 project
(http://gnuwin32.sf.net) has nearly all the gnu unix tools for msdos.
You'd probably have no problem using gnu read and gnu echo.

 
Answer #3    Answered On: Nov 24    

I'm not so sure about that. I know echo works in both.

In linux:
[myusername@cm-208-152-6-95 etc]$ echo "some stuff"
some stuff
[myusername@cm-208-152-6-95 etc]$

In dos:
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>echo some stuff
some stuff

C:\>

I do write the occasional windows script but I've never writen anything
interactive with the user so I don't know what the command is for read.

 
Answer #4    Answered On: Nov 24    

set filename=
echo Enter file name
choice /N /C
echo %filename%

 
Answer #5    Answered On: Nov 24    

why don't you use cygwin ?
www.cygwin.com or www.redhat.com/software/tools/cygwin
it's reliable, it's fast, it's ...free

 
Answer #6    Answered On: Nov 24    

i'm getting following error:
----
C:\tmp\1.bat
C:\tmp>set filename=

C:\tmp>echo Enter file name
Enter file name

C:\tmp>choice /N /C
'choice' is not recognized as an internal or external command,
operable program or batch file.

C:\tmp>echo
ECHO is on.

 




Tagged: