warning in command's output , but why !
test_3 & test_4 have hey_yo text
daa@daa-Aspire-5740:~$ cat test_4 << test_3 > ahaa > bash: warning: here-document at line 91 delimited by end-of-file (wanted `test_3') hey yo questions are :: 1. why this warning ? 2. why shell is showing > symbol after cat test_4 << test_3 ! |
The format of the command you entered ('<<') is called a here-document. It allows you to input multiple lines like so:
Code:
cat <<EOF > /etc/resolv.conf Code:
cat <<monkeysuncle > /etc/resolv.conf |
Sir "kbp"
i am confused , i am not getting the actual meaning of < & > & << & >> i know that they are related to input and output . but please think about this daa@daa-Aspire-5740:~/only_for_unix$ cat > f_1 hey ya , i am 305 daa@daa-Aspire-5740:~/only_for_unix$ cat < f_1 > f_2 why i am getting output in the screen and thats why i am thinking that there is a precedence in commands also ( like 'C' language) ! please , its a request that clarify this cat < f_1 > f_2 ! |
It's probably easier to point you to an existing reference, let us know if it's still unclear after you've read this:
http://tldp.org/LDP/abs/html/io-redirection.html |
Please use ***[code][/code] tags*** around your code and data, to preserve formatting and to improve readability. Please do not use quote tags, bolding, colors, or other fancy formatting.
Also, please don't print your entire prompt line when it's not needed. It makes your code more confusing to read. Limit your post to only things that are important for the conversation. Quote:
Quote:
The command "cat > f_1" will redirect anything it receives to file f_1, but since there are no input filenames or "<" redirects given, the input can only come directly from you. Did you type "hey ya , i am 305" yourself after the command? Because that's the only way it would show up normally. Generally running cat with no input means that it will just sit there waiting for some (until it's killed or receives a ctrl+D EOF signal). If you type something and hit enter, it will be redirected directly into the file. "cat < f_1 > f_2" simply copies the current contents of f_1 into f_2. If you run "cat < f_1", with no output file, then the contents of file f_1 are printed directly to your terminal, the default stdout. |
sorry for mistake ,
its seems , that if i have added any output file to the syntax than it will not produce any input to the terminal ! |
Quote:
|
All times are GMT -5. The time now is 03:42 PM. |