Execute a UNIX script from DOS prompt.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Execute a UNIX script from DOS prompt.
# 1  
Old 07-01-2006
Execute a UNIX script from DOS prompt.

Hello,

I m trying to execute a UNIX task from windows, I am copying few csv files from UNIX platform to my windows using a bat file like

the txt file is as follows :

open 172.21.13.239
root
root
lcd C:\Documents and Settings\aparna_sharma\Desktop\Trunk_Analysis
cd /opt/Trunk_Analysis/
prompt
mget Final_Call_type26.csv
bye

and bat file is as :
ftp -s:download.txt

however , this bat file executes after i manually execute the script after logging onto the unix system, what i want to add is to execute the script before the command mget Final_Call_type26.csv and the next step is that the xecution shld be interactive i mean the input variables that needs to be given an interactive session b/w UNIX and DOS.....

After searching through this forum and google i heard abt dos2unix and unix2dos.... ssh command ... but i m not clear with there usage and functions.....


Pls suggest with possible answeres....

Thks in advance...........

Aparna
# 2  
Old 07-03-2006
To grab input in a batch file, assuming a modern version of Windows (I believe NT4 and above, but not 100% sure,) you can use SET:
Code:
SET /P myvar=Enter prompt here:

For more information, see SET/? in Windows (Start -> Run -> cmd)

On the other hand, if you just want a shell on the Unix box, do look into shell. Install a client, such as PuTTY. Log in, depending on the client you install, and issue command to your heart's content. For example, if you have a command-line ssh client, you can typically do:
Code:
ssh user@hostname

Unless you've done some work to automate logins, you'll be prompted for your password. Once that's provided, you're on the host as if you were sitting at a console, more or less.
# 3  
Old 07-03-2006
Hello

Thanks for the information but how i should execute the script ...
like the script
: echo " hello " >> hello.csv

and i make a bat file to fetch hello.csv so i need to execute the script ....
i tried using ssh but its not working..pls suggest

Thks
Aparna
# 4  
Old 07-04-2006
I'm not understanding the issue. What do you mean "ssh is not working"? What have you tried? Did you get an error? How do you know it's not working?

And can you give a full example of what you're trying to do? Where is the script created? Where is it executed? How is it built?
# 5  
Old 07-08-2006
Hello

Yes i will explain what i want to do......

there is a script on UNIX platform ....
i want to execute the script from DOS and retrive the output...
like in my first thread i explained that i am able to fetch the output by a batch file in same batch file can i run the script also that's placed on my unix platform....

Pardon me if i m still not clear with the task ....
if not pls reply will give more details

Thks
Aparna
# 6  
Old 07-11-2006
Hi,

Have you thought about or can u use the Microsoft SFU (Services for Unix) then you would not have to worry about the DOS prompt. It contains all the common UNIX utilities, including some shell scripting.

I dont know if you are allowed to have this on your network or not, but if you are the Admin, im sure you can do it as long as its not against your company policy.

Here is the link to both download it and read about it:

http://www.microsoft.com/technet/int...u/default.mspx
# 7  
Old 07-11-2006
I also would like to ask how to execute UNIX command thru batch script??

can someone give me a hint how to make batch script that can execute script on unix??

any ideas??
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Script to convert dos to UNIX in Solaris

Hi Team, I am trying to implement a script in Solaris, that required to find the list of files inside directories and convert those to dos2unix conversion, Can someone please help here.. Below is the example of scenario.... (1 Reply)
Discussion started by: Logics123
1 Replies

2. Shell Programming and Scripting

Batch script to execute shell script in UNIX server

Hi team, My requirement is to transfer pdf files from windows machine to unix server and then from that unix server we should sftp to another server. I have completed the first part i.e From windows to using to unix server with the help of psftp.exe code: psftp user@host -pw password <... (1 Reply)
Discussion started by: bhupeshchavan
1 Replies

3. Shell Programming and Scripting

Dos batch script to execute unix shell script

Can anyone help me with a dos batch script to execute a shell script residing in an unix server. I am not able to use ssh. Thanks in advance (2 Replies)
Discussion started by: Shri123
2 Replies

4. Shell Programming and Scripting

Use Unix shell script to open Windows command prompt (cmd)

Hello, I work on Windows and I use Putty to access a remote UNIX server. I am trying to build a shell script that will have as main task to open the Windows command prompt (cmd) and run some Windows commands thereafter. The commands are actually file transfer commands that will download a file... (14 Replies)
Discussion started by: rookie2785
14 Replies

5. Homework & Coursework Questions

Unix Shell Script to prompt customer for name etc

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: How do I create a shell script called 'custinfo' to prompt a customer to enter and display back the following:... (4 Replies)
Discussion started by: SQLScript
4 Replies

6. Shell Programming and Scripting

Execute unix shell script to text file using the script

Hi all, I am beginner in UNIX...I want to use unix shell script to create text.file...I know how to use using by command...can anybody tell me for the script? Thanks i changed the threads title from "tex file" to "text file", because "tex" would probably be misunderstood as reference to... (4 Replies)
Discussion started by: mastercar
4 Replies

7. Windows & DOS: Issues & Discussions

Hide svchost.exe (dos prompt) when executing scheduled task

hello everyone. I created a java program that will pop up a dialog, and scheduled it as a task. Everything works fine except when the scheduled java program runs and the dialog pops up, there is another dos prompt (svchost.exe) hanging behind the dialog box and doesn't go anywhere until the java... (0 Replies)
Discussion started by: milhan
0 Replies

8. Shell Programming and Scripting

execute shell file on DOS prompt

I have installed cygwin on my computer having windows 2003 server as operating system. The following command works fine on DOS console: bash launch_update.sh Is there any way, that i could run the above shell file, just by typing its name on DOS prompt, in the same way as batch files are... (1 Reply)
Discussion started by: mmunir
1 Replies

9. UNIX for Dummies Questions & Answers

Can Unix (Solaris) execute a dos .bat script?

I did a search and found lots of questions/comments about how a dos script could execute Unix but not the other way round. If it's possible, I'd like the link to a post/site that would show me the way. Thanks. (4 Replies)
Discussion started by: BCarlson
4 Replies

10. UNIX for Dummies Questions & Answers

?Using Unix commands in Microsoft (Windows') DOS Prompt?

I ran a search for "Unix Dos" in the search field box and checked a few pages' results but did not find what I was looking for. I am trying to find out if there are choices of applications that would enable using Unix commands inside a Windows environment, particularly the DOS Prompt. The only... (2 Replies)
Discussion started by: HLee1981
2 Replies
Login or Register to Ask a Question