LinuxQuestions.org
Review your favorite Linux distribution.
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 04-28-2003, 06:12 AM   #1
andym
Member
 
Registered: Apr 2003
Location: UK
Posts: 52

Rep: Reputation: 15
scripts???


i am running redhat 9 and wish to automate a process can i use a script to do this, if so:

what exactly is a script

how do i make one

i am very new to this so please excuse my stupidity
 
Old 04-28-2003, 06:46 AM   #2
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,185

Rep: Reputation: 52
a list of commands you would have typed, but instead
existing in a text file, made executable, so that when
you type the name of the text file, the commands in it
are run.
like
echo "ls -l" > l
chmod 755 l
l
runs ls -l
 
Old 04-28-2003, 07:02 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531
like
echo "ls -l" > l
chmod 755 l
l
runs ls -l

]$ bash: l: command not found
No it doesn't :-]

It's only run as "l" if the current directory you're in (pwd or echo $PWD) is in your "$PATH" statement (echo $PATH), else it's run as "./i", or "sh ./l" if you didn't set the executable bits.

Here's some docs you might wanna read:
Introduction to BASH shell scripting: http://www.linuxorbit.com/modules.ph...icle&artid=459
A Quick Introduction to Bash Programming: http://www.geocities.com/tipsforlinu...cles2/043.html
A's to Q's about BASH, the Bourne-Again SHell: http://apodeline.free.fr/FAQ/bashFAQ/bash.html
BASH Programming - Introduction HOW-TO: http://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
Advanced Bash Scripting Guide (ABS): http://www.tldp.org/LDP/abs/html/

Shell script resources:
Search LQ!
Heiner's SHELLdorado: http://www.shelldorado.com
Linuxguru's shell scrip resources: http://www.linuxguruz.org/z.php?id=911

Last edited by unSpawn; 04-28-2003 at 07:09 AM.
 
  


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
VPN: Debian Scripts -> Mandriva 2006 Scripts Undefined Mandriva 0 11-30-2005 01:10 PM
Need help running scripts from scripts sdouble Linux - Newbie 3 05-31-2004 01:56 PM
What scripts would you like to see? kittani Linux - Software 1 05-20-2004 04:26 AM
Scripts? zombie killa Linux - Software 5 05-29-2003 06:19 PM
scripts mdjames0 Linux - Newbie 4 08-02-2002 10:10 PM


All times are GMT -5. The time now is 05:06 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration