LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 06-02-2003, 09:46 PM   #1
Nicksan
Member
 
Registered: May 2003
Posts: 84

Rep: Reputation: 15
Script question?


What the heck is a script?, and what do they do?
 
Old 06-02-2003, 09:51 PM   #2
manthram
Member
 
Registered: Feb 2002
Location: Fairfax, VA
Distribution: RedHat 8, Mandrake9.1, Slack9
Posts: 456

Rep: Reputation: 31
well you see when you want to start an application from the command line you type the command. now if you write that command in the file and make that file executabale and then run it then you have got a script for yourself

but of course you have to tell it how to interpret it in the very first line of the file by giving the shell path you want to use
 
Old 06-02-2003, 10:31 PM   #3
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
A script...

... when BASIC meets C.


/me is easily amused tonight.
 
Old 06-03-2003, 10:12 AM   #4
jkcunningham
Member
 
Registered: May 2002
Location: Seattle, WA, USA
Distribution: Gentoo
Posts: 136

Rep: Reputation: 15
A script is a text file full of commands. The type described above would be a shell script. If you're running bash, its a bash script. The first line of the file tells the shell what kind of script it is, but it isn't necessary unless you want to make it executable and run the script itself as a command.

#!/bin/bash

makes it a bash script. Here are some other script file headers that interpret the files using different languages:

#!/usr/bin/perl
#!/usr/bin/python
#!/usr/bin/matlab
#!/usr/bin/octave

There are dozens, maybe hundreds of scripting languages. But you can write some commands in a file w/o the header and just call the script interpreter directly:

> bash somescript.sh
> perl somescript.pl

etc. Its pretty loose and depends on the language in question. Scripts can call other scripts.

-Jeff
 
  


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
script question lordofring Linux - Software 2 10-27-2005 01:15 PM
Script question yoderp Linux - General 8 07-06-2005 09:57 AM
Question on this script. Echo Kilo Programming 2 12-13-2004 05:20 AM
script question shanenin Linux - Software 2 04-04-2004 11:39 AM
Script Question blas Linux - General 5 02-14-2004 01:48 AM

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

All times are GMT -5. The time now is 04:18 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