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

Post here if you are a new Porteus member and you're looking for some help.
testsforknowledge
Black ninja
Black ninja
Posts: 42
Joined: 07 Jan 2013, 16:44
Distribution: PORTEUS
Location: slovenia

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

Post#1 by testsforknowledge » 01 Mar 2013, 09:34

>> 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)
Last edited by testsforknowledge on 01 Mar 2013, 09:51, edited 1 time in total.

testsforknowledge
Black ninja
Black ninja
Posts: 42
Joined: 07 Jan 2013, 16:44
Distribution: PORTEUS
Location: slovenia

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

Post#2 by testsforknowledge » 01 Mar 2013, 09:51

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 ...):)

hypomania
Samurai
Samurai
Posts: 130
Joined: 10 Mar 2011, 10:50
Distribution: Windows phone
Location: Saudi Arabia

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

Post#3 by hypomania » 01 Mar 2013, 16:23

hi,
you can use "dosbox" to run *.bat for windows on linux too.
Good luck

User avatar
Hamza
Warlord
Warlord
Posts: 1908
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

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

Post#4 by Hamza » 01 Mar 2013, 18:05

now i need to find available commands

Code: Select all

help
NjVFQzY2Rg==

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

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

Post#5 by brokenman » 02 Mar 2013, 00:09

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.
How do i become super user?
Wear your underpants on the outside and put on a cape.

Post Reply