Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
a few simple things [i hope:]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
colin
n00b
n00b


Joined: 13 Nov 2002
Posts: 18

PostPosted: Sun Nov 17, 2002 8:49 pm    Post subject: a few simple things [i hope:] Reply with quote

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
Code:
./someshellscript
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
View user's profile Send private message
colin
n00b
n00b


Joined: 13 Nov 2002
Posts: 18

PostPosted: Mon Nov 18, 2002 2:51 am    Post subject: Reply with quote

anybody? :[
Back to top
View user's profile Send private message
qwkbrnfox
Apprentice
Apprentice


Joined: 05 Nov 2002
Posts: 231
Location: Vancouver, BC, Canada

PostPosted: Mon Nov 18, 2002 4:27 am    Post subject: Reply with quote

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
View user's profile Send private message
colin
n00b
n00b


Joined: 13 Nov 2002
Posts: 18

PostPosted: Mon Nov 18, 2002 9:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
eric_s
n00b
n00b


Joined: 18 Nov 2002
Posts: 16

PostPosted: Mon Nov 18, 2002 10:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
wHAcKer
Apprentice
Apprentice


Joined: 18 Oct 2002
Posts: 228
Location: Grimbergen, Belgium

PostPosted: Mon Nov 18, 2002 10:51 pm    Post subject: Reply with quote

doesn't sh /home/whacker/script work as well?
it works here ;)
Back to top
View user's profile Send private message
eric_s
n00b
n00b


Joined: 18 Nov 2002
Posts: 16

PostPosted: Mon Nov 18, 2002 11:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum