Code: Select all
@echo off
set /p Filen = Please type a file name:
echo filename is %Filen%
:existing
if exist %Filen% goto newfile
if not exist %Filen% goto newfile
:makeline
set /p linetext = Please enter a line of text:
echo %linetext% >> %Filen%
echo File has been created!
:newfile
set /p filen = File exists. Please type a new file name:
goto existing
pause
And out of interest sake, how will the code look for execution in linux?