Unix Shell - starting a script at startup

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > December 2006 > starting a script at startup





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author starting a script at startup
Gary Wessle

2006-12-10, 7:25 pm

Hi
I have this script which suppose to change the directory and fire the
proj file.

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# User specific aliases and functions

cd myProg/str1
/sbin/fuser proj >/dev/null || proj


which outputs the following in my xterm window.
bash: cd: myProg/str1: No such file or directory
bash: proj: command not found
[fred@localhost str1]$ emacs &
[1] 2281
[fred@localhost str1]$

how can I do it?

thanks
Bill Marcum

2006-12-10, 7:25 pm

On 11 Dec 2006 11:39:02 +1100, Gary Wessle
<phddas@yahoo.com> wrote:
> Hi
> I have this script which suppose to change the directory and fire the
> proj file.
>
> # .bashrc
>
> # Source global definitions
> if [ -f /etc/bashrc ]; then
> . /etc/bashrc

/etc/bash.bashrc is automatically sourced if it exists.

> fi
>
> # User specific aliases and functions
>
> cd myProg/str1
> /sbin/fuser proj >/dev/null || proj
>
>
> which outputs the following in my xterm window.
> bash: cd: myProg/str1: No such file or directory
> bash: proj: command not found
> [fred@localhost str1]$ emacs &
> [1] 2281
> [fred@localhost str1]$
>
> how can I do it?
>
> thanks


Create the directories myProg and myProg/str1, make sure a command called
"proj" is in your $PATH, or have your script test whether they exist
before trying to use them.


--
I wish I was a sex-starved manicurist found dead in the Bronx!!
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com