LinuxQuestions.org
Register a domain and help support LQ
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 01-28-2004, 07:26 PM   #1
PyroBoy101
LQ Newbie
 
Registered: Jan 2004
Distribution: Mandrake
Posts: 23

Rep: Reputation: 15
Question DOS batch equivalent


Hey all, first time poster here.

I know the basic basics about linux plus a little more. I was wondering if there is some sort of Linux equivalent to a .bat file like in DOS where you just type the commands as you would normally and then just run the batch file to make it do a whole big list of things. What I really need it to do is a big series of mounts, umounts, and dd commands.

Can perl do something like this? Is there something else that does it and is easier? I am working with an old school P166 machine (aka, the linuxbeast ) that can't run X with its vid card so I'm stuck in text mode only.

Thanks in advance
 
Old 01-28-2004, 07:28 PM   #2
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Rep: Reputation: 46
bash script / perl script / ...
mention the type of script at the start of the file, and then just execute it.
 
Old 01-28-2004, 07:37 PM   #3
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Ubuntu, FreeBSD
Posts: 1,449

Rep: Reputation: 48
Right.

example
---
#!/bin/sh
mount /cdrom
umount /cdrom
dd if=/dev/cdrom of=cdrom.iso bs=2k


---
You can put anything you want in one. More than that also... but now is not the time to discuss shell programming.

Remember to set it as executable (chmod +x script.file) or you will have to type `sh script.file`

Last edited by frob23; 01-28-2004 at 07:39 PM.
 
Old 01-28-2004, 07:49 PM   #4
PyroBoy101
LQ Newbie
 
Registered: Jan 2004
Distribution: Mandrake
Posts: 23

Original Poster
Rep: Reputation: 15
Wow! Thanks for the fast responses! I was expecting to wait at least until later tomorrow to get anything but you guys really impressed me. That is exactly what I was looking for. I might need to hang around here more often...
 
Old 01-28-2004, 07:52 PM   #5
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Rep: Reputation: 46
http://www.tldp.org/LDP/abs/html/

theres bash scripting.

also, look up tldp.org whenever u have some. they have a lot of good guides and howto-s there.
 
Old 01-28-2004, 09:08 PM   #6
statmobile
Member
 
Registered: Aug 2003
Location: Chapel Hill, NC
Distribution: Gentoo, Windows 95 2000 & XP
Posts: 160

Rep: Reputation: 30
Welcome PyroBoy,
Yeah the gurus in these forums not only arent' intimidating, but they're very quick to help. Personally, I learned my batch scripting from the
Rute User's Tutorial

Check Chapter 7 on Shell Scripting.
 
  


Reply


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
equivalent of DOS command /p TranceDude Linux - Software 6 08-13-2005 12:49 AM
Batch File Equivalent johnsmith1169 Programming 4 05-16-2004 08:10 PM
"batch files" in red hat, similar to .bat files in dos shycalais Linux - Newbie 2 10-12-2003 09:34 AM
Are linux scripts just as simple as dos batch files? neeyo Linux - General 4 07-21-2002 12:42 PM
Like MS-DOS batch file but for Linux? rverlander Programming 2 06-23-2002 03:51 PM


All times are GMT -5. The time now is 06:45 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration