LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-27-2004, 10:18 PM   #1
denizen
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
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Debian, FreeBSD
Posts: 1,450

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
denizen
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
wijnands
Member
 
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
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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