Python Forum
iatoc a script to list executable files
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iatoc a script to list executable files
#1
i am thinking of coding a script to take command line arguments as command names and find all matches in the list of directories in the PATH environment variable and list them. if the directory has a symlink. list both the symlink and the referenced file. this would be for platforms that use the PATH variable. is there a more portable way to do this?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
grep? (for contents)
file? (for filenames)
or glob from within script.
Reply
#3
it's like the shell "which" command but it lists matches in all the directories so you know what can still run even if the file is removed. and for each, instead of just sowing the path, it runs "ls" to show more detail. you can see how big it is or if it's a symlink.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020