[Nottingham] Bash files

James Gibbon jg at jamesgibbon.com
Fri Feb 20 20:32:02 UTC 2009


On Thu, 19 Feb 2009 20:54:23 +0000 (GMT)
Ron Wilton <ron_w_add at yahoo.co.uk> wrote:

> Hello
> 
> I'm wanting to do a bash file, i.e. starting with
> 
> #!/bin/bash
> 
> I know what I want to put in it, but I can't remember where to put it.
> 

If you'd like to run it without specifying the whole pathname,
then put it in a directory that's in your $PATH. Personally I
use a directory called 'scripts' off my home directory.

My .bashrc contains

export PATH=$PATH:$HOME/scripts

So if I write a script called 'foo', I can run it by simply typing
'foo' rather than (eg) '~/scripts/foo'

Hope that's clear,
James




More information about the Nottingham mailing list