LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-21-2011, 03:47 PM   #1
a_d1234
LQ Newbie
 
Registered: Nov 2011
Posts: 1

Rep: Reputation: Disabled
Command errors vs. bash errors


Hi guys.
What are the differences between these two kinds of errors? (command error vs. bash error)
I'm an absolute newbie, so any help will be appreciated.


$ wc -l /etc/password
wc: /etc/password: No such file or directory
$ wc -l < /etc/password
bash: /etc/password: No such file or directory
 
Old 11-21-2011, 04:49 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650
None really .. the error is displayed by the shell and shows the process that reported the error.

In the first case the process was 'wc' as it attempted to open the file.

In the second case it was 'bash' as it tried to open the file and feed it to 'wc' as input.
 
1 members found this post helpful.
Old 11-21-2011, 04:53 PM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958
bash is, in the end, just another command. In the first line, the wc command is giving you an error, and in the second, it's the shell.

The reason for the difference is that in the first case bash launches wc with the filename passed to it as an argument. wc then looks for the filename that it was given, can't find it, and complains.

In the second case, you're using a redirection, which is a function of the shell. Now it's bash that's looking for the file, so that it can open it and send the contents into wc, and complaining when it can't be found.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
repeatable disk read/write errors with no errors logged by kernel or SMART mxl2 Linux - Hardware 9 04-02-2011 10:27 AM
yum update transaction check errors & mirror errors tonycunn Linux - Software 2 11-29-2010 09:16 AM
Bash script has errors smeezekitty Programming 30 11-19-2009 04:34 PM
Errors, Errors, and more Errors (KDE 3.4.x GUI Errors) Dralnu Linux - Software 2 05-13-2006 09:30 AM
bash errors after update JonathonReinhart Linux - Software 13 01-21-2006 01:48 PM


All times are GMT -5. The time now is 06:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration