Redirection related clarifications required...


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Redirection related clarifications required...
# 1  
Old 08-21-2008
Redirection related clarifications required...

There are two files named goody and good. Please look at their single line contents:-
$ cat goody
hi m goody
$ cat good
hi m good

1)
$ cat goody < good
hi m goody

When we give cat, a file to read from, standard input is ignored.
As such, the above operation will just display contents of goody.


2)
$ cat > goody < good
$ cat goody
hi m good
$ cat good
hi m good

What will be the output of the above command ? I think the command takes input from file good and then overwrites in goody and prints on terminal screen.

3) Whats the difference between a) cat goody >>= good and b) cat goody >> good

4) Whats the difference between a) cat goody >= good and b) cat goody > good

5) Whats the difference between cat < good and cat << good


Thanks a lot in advance.

Best Regards,
Marconi.
# 2  
Old 08-21-2008
do we have anything called <<= and >>=..
i am not able to recall...
# 3  
Old 08-21-2008
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

need downloading related help...but its not related to unix

Hi All, I am trying to dowmload the zip file "zkManageCustomers.zip " but i dont have access. Can anyone help me to download this file See the below link- http://www.ibm.com/developerworks/opensource/library/wa-aj-open/index.html?ca=drs- Please help me as early as... (1 Reply)
Discussion started by: aish11
1 Replies

2. UNIX for Dummies Questions & Answers

about different redirection

explain the redirections 1>, 2>, 3>, ..... and 1< ,2<,3<..... where we use these things thanks Thread moved from AIX forum (2 Replies)
Discussion started by: tsurendra
2 Replies

3. Shell Programming and Scripting

Redirection

Hello All, I am using the below script to gather various tools running by the user, we have more than 100 tools running on the server so my challenge is to redirect memory & cpu load to the file with the name of the tool.so am using the below script i am stucking how to redirect to the file... (2 Replies)
Discussion started by: ajaincv
2 Replies

4. Shell Programming and Scripting

I/O redirection

Hello everyone,I'm reading a book and there's code fragment: exec 3>&1 ls -l 2>&1 >&3 3>&- | grep bad 3>&- exec 3>&- It says that the red part of that code does not close fd 3 but the green does close the fd 3.I can't understand that.....Why?Any predicate will be appreciated.:) (18 Replies)
Discussion started by: homeboy
18 Replies

5. UNIX for Dummies Questions & Answers

Help with Redirection

Hi Guys, I m new to UNIX and new to this forum. Was wondering if someone can help me understand redirection (standard input output pipeline etc) for starters, not too sure what this would mean who | sort > sortedfile | pr | lp im starting to understand common commands but when throwing... (2 Replies)
Discussion started by: jmack123
2 Replies

6. Shell Programming and Scripting

Getting required fields from a test file in required fromat in unix

My data is something like shown below. date1 date2 aaa bbbb ccccc date3 date4 dddd eeeeeee ffffffffff ggggg hh I want the output like this date1date2 aaa eeeeee I serached in the forum but didn't find the exact matching solution. Please help. (7 Replies)
Discussion started by: rdhanek
7 Replies

7. Shell Programming and Scripting

Scripting related .

Could any body give the solution/script to get the below... 1.script will run and detcect the files having 0kb size , and give the solution in a out put file.(Will search the file in the path let say /abc/M/) 2.Same as the above also send a mail to your mails id , with the file name stating... (13 Replies)
Discussion started by: alexMar
13 Replies

8. UNIX for Advanced & Expert Users

password required when using input redirection

Hello, I need to change user and run some commands by using a script. lets say, I'm using su - someuser << start password required -----> how can I enter the password here command 1 command 2 command 3 command 4 start While trying to run this I got the following message: "standard... (2 Replies)
Discussion started by: Alalush
2 Replies

9. Shell Programming and Scripting

redirection

Hi, The code below works, it's a part of a bash shell script that serve to search a pattern $pattern_da_cercare in the files contained in a directory $directory_iniziale. Now the proble is: How can I redirect stderr to a file? PS: so I want to redirect ALL the errors to a file. I tryed... (9 Replies)
Discussion started by: DNAx86
9 Replies

10. Programming

Help with redirection

Here is my problem. I don't know make this redirection thing work. The output file (called output.c) looks like this #include<stdio.h> int main() { int k; int m; print f("%d\n", k); printf("%d\n", m); return 0; } the input file(called input.c) is this #include<stdio.h> int... (2 Replies)
Discussion started by: Shallon1
2 Replies
Login or Register to Ask a Question