Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-27-2004, 10:18 PM   #1
LQ Newbie
Registered: Jul 2004
Distribution: slackware
Posts: 19

Rep: Reputation: 0
Linux batch files

Anyone who is familiar with dos should be familiar with the old batch files.Simple programs created to execute a string of command line commands.My question is this, is there anyway I can create something like a dos batch file in linux?

If so what do I need to do it, and how do I do it.
Old 07-27-2004, 10:20 PM   #2
Senior Member
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Ubuntu, FreeBSD
Posts: 1,449

Rep: Reputation: 48
It is called a shell script

Just start it with
#!/bin/sh (or whatever shell the commands are for)
type all the commands below it

And chmod +x the_filename.

There... same exact thing.

EDIT: Well not exactly the same thing... these are hundreds of times more powerful and you can program whole programs with them. But in their simplest form... they are exactly like batch files.
Old 07-27-2004, 10:34 PM   #3
LQ Newbie
Registered: Jul 2004
Distribution: slackware
Posts: 19

Original Poster
Rep: Reputation: 0
Thank you very much.

Yeah, I know batch files can't do a lot but are quite handy.I'll have to look into these shell scripts.
Old 07-28-2004, 03:56 AM   #4
Registered: Mar 2004
Posts: 132

Rep: Reputation: 15
and something else I once searched myself silly for. Quite often you'll need to execute your script by typing ./scriptname


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch files in linux? fuelinjection Linux - General 10 05-19-2005 07:49 AM
Batch files spotslayer Linux - Software 3 06-18-2004 07:31 PM
Are there batch files in linux? njbrain Linux - General 3 03-24-2004 04:58 AM
Linux Batch Files sfnitro230 Slackware 13 03-09-2004 02:51 PM
Are linux scripts just as simple as dos batch files? neeyo Linux - General 4 07-21-2002 11:42 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:44 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration