. Explain the following unexpected result:
$ whereis date
date: /bin/date ...
$ echo $PATH
.:/usr/local/bin:/usr/bin:/bin
$ cat > date
echo "This is my own version of date."
$ ./date
Fri May 22 11:45:49 PDT 2009
 👍
 👎
 👁
 ℹ️
 🚩
1 answer

I will annotate each statement for your information.
1.$ whereis date
date: /bin/date ...
2.$ echo $PATH
.:/usr/local/bin:/usr/bin:/bin
3.$ cat > date
echo "This is my own version of date."
4.$ ./date
Fri May 22 11:45:49 PDT 2009
Annotations for line:
1. "whereis date" tells us where the executable file "date" is located, according to the current $PATH value. The result tells us that the executable file "date" is found in /bin
2. echo $PATH
tells us what is the content of the $PATH environment parameter. Each path is separated by a colon ":".
3. "cat > date"
takes standard input (stdin) from the keyboard and put the keyed in content into a new file in the current directory called date. The input should be terminated by a controld, which is not mentioned in the question.
The file "date" usually has a permission of 644 or 600 (depending on the computer implementation), which means that it is not executable.
4. ./date
attempts to execute the file ./date, but it is not executable (by default). Again, depending on the implementation of the system, it may return
"permission denied", or
possibly search for the next directory from the $PATH environment variable, which outputs the current date and time. 👍
 👎
 ℹ️
 🚩
MathMate
Answer this Question
Related Questions

geography
What date on the timeline marks the beginning of the Jewish Diaspora? A. c. 1200 BCE B. c. 900 BCE C. c. 722 BCE D. c. 587 BCE

Art
You have two boxes of colored pens. The first box contains a red pen, a blue pen, and a green pen. The second box contains a yellow pen, a red pen, and a black pen. What is the set that represents all the pens? (1 point) {red pen, blue pen, green pen}{red

Math
For each problem pick a bin from each row. Subtract to find how many more bottles are in the bin from the top row than the bottom row. 15,12,13,9,7,8

MATH
Inverse mutual funds, sometimes referred to as “bear market” or “short” funds, seek to deliver the opposite of the performance of the index or category they track and can thus be used by traders to bet against the stock market. The following table

Language Arts
Which information would you use to find out if a source is credible when researching the health benefits of standing desks? Select two answers. A) study sample size B) article publication date C) positive product reviews D) a friend's story about her

Math
1. An invoice is dated August 29 with terms of 4/15 EOM. What is the discount date? 2. What is the net date for the scenario in the previous question?

English help
the date, time, and location of a robbery would most likely be included in? A feature article an editorial article a hard news article a letter to the editor I thought a featured article but really not sure

Accounting
On April 1, 2013, Ringo Company borrowed $20,000 from its bank by using a 9%, 12 month note, with the interest to be paid on the maturity date. I need to find the interest paid on the maturity date, prepare a journal for it, and then make a reversing

math
Jennifer Rick went to Sunshine Bank to borrow $3,500 at a rate of 10¾%. The date of the loan was September 7. Jennifer hoped to repay the loan on January 15. Assume the loan is calculated using ordinary interest. How much will Jennifer totally repay?

math
A rectangular bin 4 feet long, 3 feet wide, and 2 feet high is solidly packed with bricks whose dimensions are 8 inches, 4 inches, and 2 inches. The number of bricks in the bin is A. 54 B. 648 C. 1298 D. NONE

History
Look at the timeline of important events in early Jewish history. A timeline shows key events in Jewish history from 1200 B.C.E. to 400 B.C.E. What date on the timeline marks the beginning of the Jewish Diaspora?

math
A standard size of a certain bin holds 2 2/3 gallons . The larger size of that bin is 1 1/4 times larger. How many gallons does the large bin hold ?

Probability and Statistics (Continuation)
Assume 10% of the engines manufactured on an assembly line are defective. If engines are randomly selected one at a time and tested. What is the probability that the third nondefective engine will be found a)on the fifth trial? b) on or before the fifth

math(simple interest)
A $9,000 loan is to be repaid in three equal payments occurring 60, 180, and 300 days, respectively, after the date of the loan. Calculate the size of these payments if the interest rate on the loan is 7 1/4%. Use the loan date as the focal date.

Japanese
こんにちは。たなかです。きょうは にがつ じゅうごにちです。わたしの たんじ... 23. From the passage you know that ____________. あしたは げつようびです。 あしたは すいようびです。 あしたは

English
Choose the group of words in each sentence that is missing hyphens. If no hyphen are needed, select Correct as is. 1: We have had up to date insulation put into the walls of our house. A:up to B:up to date*** C:date insulation D:Correct as is 2:Hilary

corporate finance
you are thinking of retiring. your retirement plan will pay you either $250,000 immediately on retirement or $350,000 five years after the date of your retirement. which alternative should you chose if the interest rate is a) 0% per year; b) 8% per year

Maths
Principal  6000 Rate  5% Effective Date  May 15 Maturity Date  November 1 Partial Payment Amount  $1500 Partial Payment Date August 15 Also Answer the following questions: 1. NUMBER OF DAYS BETWEEN EFFECTIVE DATE AND PARTIAL PAYMENT = 2. INTEREST ON

MATH
Your original purchase price was $825.00 plus 7% sales tax. You enter into an agreement where the interest (12.5% APR) is waived for the first 12 months provided you make the required monthly payments; otherwise the interest is accrued from the date of

Biology
Sort the terms and phrases as to whether they function in or describe primary growth or secondary growth? Place each term or phrase to the appropriate bin. If the term or phrase describes both primary and secondary growth, place it to the "both" bin. If
Still need help?
You can ask a new question or browse existing questions.