compiz-kde on Feisty

Chris Miller lordsauronthegreat at gmail.com
Tue Feb 20 15:02:52 UTC 2007


On 2/20/07, mehmet Dilmac <cilazma at gmail.com> wrote:
> Hii All..
>    who create a new bash scrips but i cen't create new bash scrips
>     pls send me any more doc.

Yay!  I know how to create bash scripts!

Here goes a Lord Sauron's crash-course in bash scripting (BTW: this is
a OT Post, however, I can't resist showing what I know in hopes that
some people will teach me more)

A bash script is really simple.  It's just a text file on your drive.
Sometimes they end in .sh.  A small bash script which says "Hello,
World." looks like this:

============ file /home/cmiller/helloworld.sh ===============
#!/bin/sh

echo "Hello, world!"
======================= EOF ==========================

This alone will not work.  To call this script you need to (in
terminal) type the full location to the bash script or bash <the
script>:

= Note: all these are examples given for the hypothetical bash script
I created /home/cmiller/helloworld.sh
variant 1: /home/cmiller/helloworld.sh
variant 2: <you must be in the directory the script is in> ./helloworld.sh
variant 3: bash <either variant 1 or 2>

Before you can do that, however, you need to make the file executable.
 Type chmod 755 <filename> to make the file executable.

Bash is extremely advanced and can be used for programming whole
applications (though that would be insane).

As for the docs, if you're using Kubuntu with KDE, try the man:
kioslave.  In Konqueror, simply type man: and start reading.  There's
documentation for every command under the sun in there (and a few
commands which aren't under the sun!)  I find it a handy directory of
commands to just go browsing through.

-- 
It's not much, but it's what I call 127.0.0.1




More information about the kubuntu-users mailing list