What's a script?
Karl F. Larsen
klarsen1 at gmail.com
Sun Jul 12 23:18:31 UTC 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Carl Friis-Hansen wrote:
> On Mon, July 13, 2009 00:37, Mark C. Miller wrote:
>> I'm a newbie and know nothing about programming. Here's a line I grabbed
>> from another thread
>>
>> quote
>>
>> Basically, stick your ssh commands in a script. Stick the script in the
>> appropriate start up file.
>>
>> unquote
>>
>> What does the author mean by a "script"? Is this a particular
>> programming language? Once you get it written, whatever you write it in,
>> what would be the command to execute it, once I figured out what the
>> "appropriate start up file" is?
>>
>> Sorry to be so basic, but right now if it doesn't have an interface, I
>> know little about it. I'd like to change that.
>
> I am on my way to bed now, but I will just give you a few words on your way.
>
> A script is much like .BAT files in Windows. You write scripts with a
> plain text editor like gedit if you want to work with a GUI editor. When
> you have written a script you can make it executable by changing the file
> permissions with for example nautilus file manager. When your script is
> made execuatable, you can click on it to run it or you can create a
> luncher, much like in Windows, so you can better control how it is run and
> you can stuff it in a menu or put an icon in the top bar.
>
> Have a look at some existing scripts on your computer.
>
> Here is an example of one of my very simple scripts, which is called
> run-labjack:
> /////////////////////////////////////////////
> #! /bin/sh
> #
> # By Carl Friis-Hansen June 2009
> #
>
> echo Starting Data logging with Labjack.
> echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> cd labjack2
>
> rm -f u3shmID.txt
> sleep 1
>
> echo starting u3driver
> sudo ./u3driver.sh > /home/carl/labjack2/log_u3driver 2>&1
> # sudo ./u3driver.sh
> sleep 2
>
> echo Initiating ljrun
> # ./ljrun --config > /home/carl/labjack2/log_ljrun 2>&1 &
> ./ljrun --config > /dev/null &
> sleep 4
>
> echo Initiating monitor
> ./monitor > /home/carl/labjack2/log_monitor 2>&1 &
>
> echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> echo Done.
> echo
> /////////////////////////////////////////////
>
> The very first line determines what interpreter/language is to be used.
> In this case I have used the standard shell, like you would use CMD or
> COMMAND.COM in Windows.
>
> Hope I haven't scared you. There are tons of literature about writing
> scripts for the standard batch processors.
On Linux we call it a bash file. It is a lot more complex than a .bat
files.
73 Karl
- --
Karl F. Larsen, AKA K5DI
Linux User
#450462 http://counter.li.org.
Key ID = 3951B48D
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFKWm9HNuSIOjlRtI0RAvjuAKCODUg9I7tz3hZMzw0+bLAatPrydgCeNWAS
imnJIyA0xLgPEg064c2Ld/w=
=IJuF
-----END PGP SIGNATURE-----
More information about the ubuntu-users
mailing list