Neither "which" nor "find" commands work

 
Thread Tools Search this Thread
Operating Systems OS X (Apple) Neither "which" nor "find" commands work
# 1  
Old 02-08-2010
Neither "which" nor "find" commands work

hi there, could use some basic PATH advice, i think, or something

find sometimes work, but which hasn't ever seemed to. for years!

what am i doing wrong that the commands which and find rarely work?

they used to work on the workstations i used ages ago...

running 10.5.8 because i survive off of scientific shareware

am concerned that this is a symptom of a deeper ill

hopefully just my ignorance & nothing more Smilie
# 2  
Old 02-08-2010
Code:
linkslice:~ Bryan$ echo $PATH
/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
linkslice:~ Bryan$ which which
/usr/bin/which
linkslice:~ Bryan$ find /usr/bin -name which
/usr/bin/which


Last edited by DukeNuke2; 02-08-2010 at 03:00 AM..
# 3  
Old 02-08-2010
Thanks, that's helpful.

Looks like Fink is a bit pushy, it horned in and took over my which. Same diff I guess

Code:
keen:~ kicks$ echo $PATH
/usr/local/bin:/sw/bin:/sw/sbin:/Library/Frameworks/Python.framework/Versions/3.0/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/X11R6/bin
keen:~ kicks$ which which
/sw/bin/which
keen:~ kicks$ find /usr/bin -name which
/usr/bin/which


Last edited by DukeNuke2; 02-08-2010 at 03:00 AM..
# 4  
Old 03-18-2010
I know once ports (similar to fink) is installed, any gnu commands or bsd stuff I download takes precedence over what was there before, most likely because of edits that the program made in your .profile
# 5  
Old 03-18-2010
Correct. It adds /sw/bin and /sw/sbin to the beginning of the path. If there's more than one of the same command the one it finds first is the one it will use. Since which exists in /sw and is before the /usr/bin in the path that is the one you want. If you want to chnge this behavior, edit your PATH and move those to later in the line.
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. UNIX for Beginners Questions & Answers

Extract delta records using with "comm" and "sort" commands combination

Hi All, I have 2 pipe delimited files viz., file_old and file_new. I'm trying to compare these 2 files, and extract all the different rows between them into a new_file. comm -3 < sort file_old < sort file_new > new_file I am getting the below error: -ksh: sort: cannot open But if I do... (7 Replies)
Discussion started by: njny
7 Replies

3. Shell Programming and Scripting

find . -path "*_nobackup*" -prune -iname "*.PDF" \( ! -name "*_nobackup.*" \)

These three finds worked as expected: $ find . -iname "*.PDF" $ find . -iname "*.PDF" \( ! -name "*_nobackup.*" \) $ find . -path "*_nobackup*" -prune -iname "*.PDF" They all returned the match: ./folder/file.pdf :b: This find returned no matches: $ find . -path "*_nobackup*" -prune... (3 Replies)
Discussion started by: wolfv
3 Replies

4. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

5. Shell Programming and Scripting

Find lines with "A" then change "E" to "X" same line

I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Discussion started by: nightwatchrenba
10 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
Login or Register to Ask a Question