Page 1 of 1

[solved] HOWTO write .BAT file? (but for linux)

Posted: 01 Mar 2013, 09:34
by testsforknowledge
>> How to write file like .BAT in win? << (in .BAT we can store number of commands, ifs and goto ... what about linux?)

in win we just write
ECHO message
and we save file as "TEST.bat". Then we can run it in console and we see "message".

How to do this in linux? How to write some application like .BAT? (in linux i think it is .SH)

Re: HOWTO write .BAT file? (but for linux)

Posted: 01 Mar 2013, 09:51
by testsforknowledge
1) open file
2) write

#comment
echo "message"

3) save file as "test.sh"
4) chmod 777 ./test.sh ()
5) run with
./test.sh


now i need to find available commands
(i need to rename multiple of files with .SH ... but also to copy some ...):)

Re: [solved] HOWTO write .BAT file? (but for linux)

Posted: 01 Mar 2013, 16:23
by hypomania
hi,
you can use "dosbox" to run *.bat for windows on linux too.
Good luck

Re: [solved] HOWTO write .BAT file? (but for linux)

Posted: 01 Mar 2013, 18:05
by Hamza
now i need to find available commands

Code: Select all

help

Re: [solved] HOWTO write .BAT file? (but for linux)

Posted: 02 Mar 2013, 00:09
by brokenman
http://forum.porteus.org/viewtopic.php? ... ual#p11923

If you a specific example of what you need to do please post and we can help. Otherwise you will learn faster by one of the millions of bash scripting tutorials on the net.