Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Get all commands from unix

Reply
Thread Tools

Get all commands from unix

 
 
Yadagiri Rao KP
Guest
Posts: n/a
 
      08-07-2003
I am doing a assignment which involves getting all possible unix
commands and add to to a list box.
Firstly I used Runtime and Process classes and used the "env" as an
arguement to process.
but where all commands are stored in order to retrieve?
pls help
Yadagiri Rao
 
Reply With Quote
 
 
 
 
Ahmed Moustafa
Guest
Posts: n/a
 
      08-07-2003
Yadagiri Rao KP wrote:
> I am doing a assignment which involves getting all possible unix
> commands and add to to a list box.
> Firstly I used Runtime and Process classes and used the "env" as an
> arguement to process.
> but where all commands are stored in order to retrieve?
> pls help
> Yadagiri Rao


Try to list the files under /bin/

 
Reply With Quote
 
 
 
 
Gordon Beaton
Guest
Posts: n/a
 
      08-07-2003
On 6 Aug 2003 22:41:34 -0700, Yadagiri Rao KP wrote:
> I am doing a assignment which involves getting all possible unix
> commands and add to to a list box. Firstly I used Runtime and
> Process classes and used the "env" as an arguement to process. but
> where all commands are stored in order to retrieve?


Get the PATH variable, a list of directories separated by ':'. The
possible commands for the current user are found in those directories.
You'll probably also need to consider the permissions associated with
each executable along with the identity (user and groups) of the
current user, since the existence alone of a file in one of those
directories doesn't mean that you can run it.

/gordon

--
[ do not send me private copies of your followups ]
g o r d o n . b e a t o n @ e r i c s s o n . c o m
 
Reply With Quote
 
Tor Iver Wilhelmsen
Guest
Posts: n/a
 
      08-07-2003
Gordon Beaton <> writes:

> Get the PATH variable, a list of directories separated by ':'. The
> possible commands for the current user are found in those
> directories. You'll probably also need to consider the permissions
> associated with each executable along with the identity (user and
> groups) of the current user, since the existence alone of a file in
> one of those directories doesn't mean that you can run it.


That still won't get all commands inherent in the user's shell - not
all of them need exist in program form.

A potential solution could be to scan the files in "man" section 1.
 
Reply With Quote
 
William Dowling
Guest
Posts: n/a
 
      08-07-2003
(Yadagiri Rao KP) wrote in message news:< om>...
> I am doing a assignment which involves getting all possible unix
> commands and add to to a list box.
> Firstly I used Runtime and Process classes and used the "env" as an
> arguement to process.
> but where all commands are stored in order to retrieve?
> pls help
> Yadagiri Rao


Look at all the executable files in all the directories in the
environment variable PATH.

Will
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running multiple Unix commands in Java Jerome Java 3 01-24-2005 07:54 PM
Unix commands implemented ? (grep, wc, cat...) Spendius Java 2 12-13-2004 01:58 PM
Need Help Differentiating Bad Commands From Incomplete Commands Tim Stanka Python 1 08-02-2004 02:08 AM
Run unix commands from Java Yadagiri Rao KP Java 2 08-05-2003 02:11 PM
Re: man pages for C commands (GCC commands) Ben Pfaff C Programming 4 06-28-2003 06:21 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57