[ubuntu-za] Some Basic Kubuntu Questions

Brenton Edgar Scott trixarian at gmail.com
Fri Aug 6 13:11:47 BST 2010


On Thu, 05 Aug 2010 14:49:43 +0200
Ian Whitfield <whitfield at federalsaints.net> wrote:

>   Hi All
> 
> Some basic questions from a (fairly) new user please..... (Kubuntu 10.04)
> 
> 1) How do I make the equivalent of a "Bat File" to launch a 'script' to 
> start a program?

Actually bash scripting is pretty easy if you know how and I use it all the time.
A simple script looks like this:
#!/bin/sh
VAR=$1
command-to-run &
another-command-to-run %VAR &

which you can save into a simple text file (you don't need the .sh extension - the #!/bin/sh tells it, it's a bash script) and then set to be executable in properties. The & at the end is to help the program background, rather than flooding your screen with text - think of it like an echo off switch. $1 is the standard first word after your run the script (followed by $2, etc) - for example ./file-to-run help would make 'help' the variable $1. You can also create variables by setting them with VARNAME=VALUE and you can call them with %VARNAME. This is really just the basics, for a more indepth look, you should try any good bash tutorial.

You can set a file exectuable via command line by just typing:
chmod +x filename

Now you can run the script with ./filename, but to make system wide, you need to type: 
sudo cp filename /usr/local/bin
which make it possible to run the program just by typing filename into your terminal.

Now to add it to startup, you just have to check under setting/preferences for the startup applications dialog, click add, type in your new command, a short description and the ok button. Now it will start whenever your system does.

You can do a whole lot more with bash script, even creating if-else loops and even creating graphical interfaces using something called gtkdialog with it.

> 
> 4) When I first installed 8.04 last year my sound worked fine. When I 
> upgraded, (full re-install), to 8.10 I had no sound. I waited for 10.04 
> but still no sound. I have tried to fix this with no success and think I 
> will wait for 10.10 but any ideas on this?

Sometimes doing a direct copy of your home folder might take along with it old files. There was a switch from esound to pulseaudio around the 8.04 and 8.10. This could mean the old esound files are overriding the pulseaudio ones or that your sound card just isn't compatible with how pulse is setup now. Even old PulseAudio conf's could be messing you up because initially the Ubuntu guys didn't do a very good job with it. It's alot better in 10.04 and I didn't have problems with it, even though I have a pretty old soundcard.

-- 
Brenton Edgar Scott <trixarian at gmail.com>



More information about the ubuntu-za mailing list