Unix/Linux Go Back    


Windows & DOS: Issues & Discussions All Windows and DOS questions should go here as well. Discuss UNIX to Windows (Desktop or Server) here!

DOS Equivalent of UNIX Command

Windows & DOS: Issues & Discussions


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 12-19-2012   -   Original Discussion by Ste_Moore01
Ste_Moore01's Unix or Linux Image
Ste_Moore01 Ste_Moore01 is offline
Registered User
 
Join Date: Jul 2010
Last Activity: 19 December 2012, 10:41 AM EST
Posts: 24
Thanks: 8
Thanked 0 Times in 0 Posts
DOS Equivalent of UNIX Command

Hi,

The title of this post is a little vague but I couldn't think of what to call it.

In Unix you can perform the following command

Code:
ftp -v IPADDRESS <<END
    put FILE
END

In a DOS command prompt, is it possible to do the same kind of thing that the "<<END" does?

So for example, I want to open a command prompt from VB6 and pass keypresses to that window but have everything output to a file.

In Unix I could do the following

Code:
bash <<END > FILENAME.txt
# The following would be sent as keypresses
echo -n "This"
echo -n "is"
echo -n "a"
echo "test"
END

This would then create a file with "This is a test" as the contents.

I hope I'm not sounding too confusing.

Any help would be greatly appreciated.

Thanks! LinuxLinux
Sponsored Links
    #2  
Old Unix and Linux 12-19-2012   -   Original Discussion by Ste_Moore01
joeyg's Unix or Linux Image
joeyg joeyg is offline Forum Staff  
modérateur
 
Join Date: Dec 2007
Last Activity: 28 November 2017, 8:06 AM EST
Location: Within two miles of a Dunkin donuts.
Posts: 2,468
Thanks: 133
Thanked 194 Times in 175 Posts
Unsure what you are trying to do, but...

In DOS, you can

Code:
copy con: testfile.txt

then type at the screen, and everything will be sent to the file until you do a CTRL-z to end the copying

or, maybe

Code:
echo abcdef >> testfile.txt

will append the abcdef to the end of the existing testfile.txt
Sponsored Links
    #3  
Old Unix and Linux 12-19-2012   -   Original Discussion by Ste_Moore01
Yoda's Unix or Linux Image
Yoda Yoda is offline Forum Advisor  
Jedi Master
 
Join Date: Jan 2012
Last Activity: 10 December 2017, 7:33 PM EST
Location: Galactic Empire
Posts: 3,612
Thanks: 254
Thanked 1,317 Times in 1,234 Posts
I don't think that is possible in DOS.

You can write a Batch File and put a PAUSE command to prompt user to press any key to continue. But there is no way to pass keystrokes.
The Following User Says Thank You to Yoda For This Useful Post:
Ste_Moore01 (12-19-2012)
    #4  
Old Unix and Linux 12-19-2012   -   Original Discussion by Ste_Moore01
RudiC's Unix or Linux Image
RudiC RudiC is online now Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 11 December 2017, 10:05 AM EST
Location: Aachen, Germany
Posts: 11,778
Thanks: 339
Thanked 3,658 Times in 3,356 Posts
I agree with bipinajith - can't be done in DOS.
But - you can replace the standard command interpreter (command.com in older versions) by sth. like complus.com (a unix-like cmd interpr. for MS OSes) or the sh.exe found in Unxutils.
The Following User Says Thank You to RudiC For This Useful Post:
Ste_Moore01 (12-19-2012)
Sponsored Links
    #5  
Old Unix and Linux 12-19-2012   -   Original Discussion by Ste_Moore01
Ste_Moore01's Unix or Linux Image
Ste_Moore01 Ste_Moore01 is offline
Registered User
 
Join Date: Jul 2010
Last Activity: 19 December 2012, 10:41 AM EST
Posts: 24
Thanks: 8
Thanked 0 Times in 0 Posts
Thanks for the help.

Quote:
Originally Posted by joeyg View Post
In DOS, you can

Code:
copy con: testfile.txt

then type at the screen, and everything will be sent to the file until you do a CTRL-z to end the copying

or, maybe

Code:
echo abcdef >> testfile.txt

will append the abcdef to the end of the existing testfile.txt
Unfortunately, this isn't exaclty what I meant.

What I wanted was to be able to use VB6 to open a command prompt (which I've managed) and then telnet onto a server by sending keypresses to the command prompt (which I've also managed) and I wanted the output for the command prompt to be sent to a file on my local machine.

I thought the best way to do this would be an equivalent of << in Unix

I have however, managed to get around it by running my telnet commands on the server and sending its output to a file on the server and then using Inet to FTP the file to my local computer.

Thanks to everyone.
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
dos/intel unix command equivalent MizzGail Windows & DOS: Issues & Discussions 6 02-06-2010 11:51 PM
what is the DOS equivalent of alias command? milhan Windows & DOS: Issues & Discussions 9 04-07-2009 04:40 PM
Unix equivalent of DOS set xxavier UNIX for Dummies Questions & Answers 3 07-11-2007 09:14 AM
Command equivalent to DOS mode for SCO 5.0.6 jgt UNIX for Advanced & Expert Users 3 05-11-2007 08:10 AM
SQL Spool equivalent command in DOS stevefox Windows & DOS: Issues & Discussions 2 01-17-2006 09:18 PM



All times are GMT -4. The time now is 11:09 AM.