How do I write a statement in dos using shell script to display a word?

April 16, 2010 - 11:14 am

I want to write a shell script in dos to display the word "Hello"

use the ECHO command:
echo Hello
or
@echo Hello
(@ keeps the command line from printing out)
"echo" with a dot:
echo.
displays a blank line
you can also add
pause>nul
to keep the shell script from closing (until a key is pressed)
so the ideal script would look something like:

@echo Hello
@pause>nul

or

@echo off
echo Hello
pause>nul

2 Responses to “How do I write a statement in dos using shell script to display a word?”

  1. Random Says:

    Just did a google search for "hello world" dos shell script, that should be a good start for you, good luck.
    References :
    http://www.febooti.com/products/command-line-email/batch-files/first-dos-batch-script.html

  2. chewie Says:

    use the ECHO command:
    echo Hello
    or
    @echo Hello
    (@ keeps the command line from printing out)
    "echo" with a dot:
    echo.
    displays a blank line
    you can also add
    pause>nul
    to keep the shell script from closing (until a key is pressed)
    so the ideal script would look something like:

    @echo Hello
    @pause>nul

    or

    @echo off
    echo Hello
    pause>nul
    References :

Leave a Reply