View previous topic :: View next topic |
Author |
Message |
colin n00b
Joined: 13 Nov 2002 Posts: 18
|
Posted: Sun Nov 17, 2002 8:49 pm Post subject: a few simple things [i hope:] |
|
|
forgive my ignorance :>
could someone tell me how to update my glibc, or link me to some relevant documentation?
also, how does one run a shell script from another directory? that is, what's the syntax for if that shellscript is in another directory? would that same syntax work for running a shell script from a menu or an icon? thanks in advance.
i <3 gentoo forums [ooh and gentoo as well]
--c |
|
Back to top |
|
|
colin n00b
Joined: 13 Nov 2002 Posts: 18
|
Posted: Mon Nov 18, 2002 2:51 am Post subject: |
|
|
anybody? :[ |
|
Back to top |
|
|
qwkbrnfox Apprentice
Joined: 05 Nov 2002 Posts: 231 Location: Vancouver, BC, Canada
|
Posted: Mon Nov 18, 2002 4:27 am Post subject: |
|
|
I'm not sure about updating glibc, but I'll take a swing at the second part. Hopefully I'm not misunderstanding...just specify the full path /home/my_name/my_script instead of ./my_script
Is this what you are looking for?
T |
|
Back to top |
|
|
colin n00b
Joined: 13 Nov 2002 Posts: 18
|
Posted: Mon Nov 18, 2002 9:50 pm Post subject: |
|
|
hmm... not really...
yknow how some files need to be run with a "./" in front of them? well... how does that work from a separate directory? |
|
Back to top |
|
|
eric_s n00b
Joined: 18 Nov 2002 Posts: 16
|
Posted: Mon Nov 18, 2002 10:01 pm Post subject: |
|
|
colin wrote: | hmm... not really...
yknow how some files need to be run with a "./" in front of them? well... how does that work from a separate directory? |
Hi Colin,
the only reson why a file needs to be run with a ./ in front of it is when '.' is not in your path (echo $PATH) which is a good thing by the way. if you run like this, it also means that you script is executable. Otherwise you will need to run it by doing something like:
# bash myscript
or
# bash ./myscript
note that ./ only specifies the current directory
../myscript would run myscript in the parent directory of you working directory.
An other place where you might need the dot is when you want to source a script without forking a new shell. You would then issue:
# . myscript.sh
or
# . ./myscript.sh
Hope this helps |
|
Back to top |
|
|
wHAcKer Apprentice
Joined: 18 Oct 2002 Posts: 228 Location: Grimbergen, Belgium
|
Posted: Mon Nov 18, 2002 10:51 pm Post subject: |
|
|
doesn't sh /home/whacker/script work as well?
it works here |
|
Back to top |
|
|
eric_s n00b
Joined: 18 Nov 2002 Posts: 16
|
Posted: Mon Nov 18, 2002 11:05 pm Post subject: |
|
|
wHAcKer wrote: | doesn't sh /home/whacker/script work as well?
it works here |
That should work everywhere...
If one does not wnat to use the sh, he might want to add this line as the first line of his script:
#!/bin/sh
And then chmod his script to make sure he has execute rights on it. |
|
Back to top |
|
|
|