Create a .bat file on Windows and a .sh file on Unix that does the following
- takes one argument,
- if the argument = 1, then display the message "this is the first argument"
- if the argument = 2, then display the time of day
- if the argument = "last", then run another script that effectively counts from 1 to 10 using a FOR loop
this is my script, but it is not working. The argument last, i dont how to create script on this also that counts 1 to 10, please help
@ECHO off
cls
:start
ECHO.
ECHO 1. Display this is the first argument
ECHO 2. Display the time of day
ECHO last. Run other script
set choice=
set /p choice=Type the argument to print the output.
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='1' goto argument
if '%choice%'=='2' goto time_day
if '%choice%'=="last" goto run_script
ECHO "%choice%" is not valid please try again
ECHO.
goto start
:argument
ECHO this is the first argument
goto end
:time_day
ECHO |TIME|
goto end
:run_script
CALL C:\WINDOWS\NEW_BATCHFILE.BAT
goto end
:end
please help