Question on "Which" command

Hi,

on my unix command line, I typed "which meter" to try to
find out the path of "meter?, the result is:

% which meter
a: Command not found.
a: Command not found.
ora: No such file or directory


What's wrong with it? I don't know how and why "a" and "ora" appear above.

Could any one help me to remove these abnormality?
Thanks,

Jennifer
jfz2004Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

brettmjohnsonCommented:
I suspect that the 'which' command has been aliased.  You can check for this by doing:

alias | grep which

0
ravenplCommented:
or try: /usr/bin/which which
0
jfz2004Author Commented:
I did a alias | grep which, it shows nothing;

also, my /usr/bin does not have which.
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

jfz2004Author Commented:
Then I did /usr/ucb/which and I got this:

/usr/ucb/which which
a: Command not found.
a: Command not found.
/usr/ucb/which


By the way, when I open a new xterm, I got:
a: Command not found.
a: Command not found.

in the new xterm. But no "ora: command not found".
Why?
0
brettmjohnsonCommented:
Ah.  It sounds like something invalid in your .profile, .cshrc. .tcshrc, or .bashrc (depending on your default shell).
Each time you start up a new shell, these get executed.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jfz2004Author Commented:
Thanks,
I checked my .cshrc and run every line in my .cshrc and I don't see any problem.
 

Jennifer
0
jfz2004Author Commented:
Also, I only have .cshrc in my home directory. When I source .cshrc,
I don't have the :

a: Command not found.
a: Command not found.

as output.

0
ahoffmannCommented:
which sources the shell's profile (see brettmjohnson's comment), hence it is unreliable to find what actually will be your "meter".
As it reports errors in your case, you most likely have a resource file (profile) which violates your shell settings, somehow in conjuntion with which ... (the reason why which is unreliable:).

Try following:
   echo $PATH|awk -F: '{for(i=1;i<=NF;i++){print "ls "$i"/meter"}}'|sh
0
jfz2004Author Commented:
Hi, I resolved it by commemting out most of the lines in my .cshrc and
that problem disappeared.

Thanks.

Jennifer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.