Sponsored Content
Full Discussion: Question on bash redirection
Top Forums UNIX for Beginners Questions & Answers Question on bash redirection Post 303035993 by sand1234 on Tuesday 11th of June 2019 11:04:15 PM
Old 06-12-2019
Question on bash redirection

Hi,

Can I get some explanation around this bash redirection?
From what I have read, x < y means call the shell to redirect the output of y into x.
Does this mean that this sequence of commands is executed from right to left?

Code:
diff <(sort testfile.txt) <(sort testfile2.txt)

Thanks,

Moderator's Comments:
Mod Comment edit by bakunin: please use CODE-tags to surround code, data and terminal output. Thank you

Last edited by bakunin; 06-12-2019 at 02:30 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash multiple output redirection

Hello all. Is there a way to redirect output to more than one file at a time? I have a method1() that writes to a logfile. In the method cksums are done on files by doing a "for i in `ls`; do cksum $i > $LOGFILE done " In the logfile I want to show the cksums under each directory like... (2 Replies)
Discussion started by: yoi2hot4ya
2 Replies

2. Shell Programming and Scripting

question on redirection (<<)

I came across the following problem, where file contents are overwritten using redirection. Can somebody please explain what cat << BAR seems to be doing and say why this is a problem? Explain the contents and relation between the two filenames used before the cat command. thanks /tmp# echo... (2 Replies)
Discussion started by: newkidintown
2 Replies

3. Shell Programming and Scripting

input redirection question

Hi, in my script I need to execute the following command: query $id 456 432 but it waits for a RETURN character from keyboard and therefore, it fails. I tried something like: query $id 456 432 << '\n' but, i'ts clear it is not correct. Is there any way to do this? Thxs. (0 Replies)
Discussion started by: luistid
0 Replies

4. Shell Programming and Scripting

File redirection question

Hi all, I am working with the Grinder tool (unrelated to my question) to redirect the output of a program to a file as follows: java -cp $CLASSPATH net.grinder.TCPProxy > grinder.txt This is a proxy server which pipes output to a file. When I do something on my proxy, more and more goes to... (1 Reply)
Discussion started by: Annorax
1 Replies

5. Shell Programming and Scripting

BASH Problem / Question regarding redirection

Hi all, Maybe someone is able to help: Need to redirect the output of a command in realtime to a second command. Command-A executes a remote shell to another host, and outputs its results. Command-B displays a "dialog" with the outputs of Command-A. Command-A Output: Updating FileA... (2 Replies)
Discussion started by: mharald
2 Replies

6. Shell Programming and Scripting

Redirection Question

I just wondered if I'm understanding this command line correctly cat 2>save1 0<memo | sort 2>save2 1>letter This means that stdin will read from memo and if there is an error then stderr will write to save1. Am I correct in saying that the sort command will sort the memo file and write... (2 Replies)
Discussion started by: snag49ers
2 Replies

7. Shell Programming and Scripting

Question about IO redirection

for shell operators like <, >, <<, and >> do the LHS always have to be a process or device and the RHS a file or device? Is it possible for the RHS to be a process? (1 Reply)
Discussion started by: stevenswj
1 Replies

8. Shell Programming and Scripting

Redirection question

I want to redirect stderr and have the following peice of code $ cat t1.ksh #!/bin/ksh func2() { diff /tmp/jdlkwjdlkejew /tmp/djlkwejdlewdjew >$OUTPUT_FILE 2>>$ERR_FILE } func1() { let counter=0 while do print -u2 "Error: In main function" func2 let... (1 Reply)
Discussion started by: BeefStu
1 Replies

9. Shell Programming and Scripting

Error redirection question

Hi gurus, I have a question, need some of your inputs... I have a command like this : export LINE_COUNT=`wc -l test.dat | awk '{print $1}'` echo $LINE_COUNT --- > gives me 2 which is fine as the file has 2 lines. This works fine if the file test.dat is present but in case... (3 Replies)
Discussion started by: calredd
3 Replies

10. Shell Programming and Scripting

Input redirection within bash script

Hi, when I try to redirect input and the command is described as a string within an array redirection does not work. why? #!/bin/bash dir=("tail < ./hello.txt") tail < ./hello.txt #works ${dir} #does not work (2 Replies)
Discussion started by: heinzel
2 Replies
GENDIFF(1)						      General Commands Manual							GENDIFF(1)

NAME
gendiff - utility to aid in error-free diff file generation SYNOPSIS
gendiff <directory> <diff-extension> DESCRIPTION
gendiff is a rather simple script which aids in generating a diff file from a single directory. It takes a directory name and a "diff- extension" as its only arguments. The diff extension should be a unique sequence of characters added to the end of all original, unmodi- fied files. The output of the program is a diff file which may be applied with the patch program to recreate the changes. The usual sequence of events for creating a diff is to create two identical directories, make changes in one directory, and then use the diff utility to create a list of differences between the two. Using gendiff eliminates the need for the extra, original and unmodified directory copy. Instead, only the individual files that are modified need to be saved. Before editing a file, copy the file, appending the extension you have chosen to the filename. I.e. if you were going to edit somefile.cpp and have chosen the extension "fix", copy it to somefile.cpp.fix before editing it. Then edit the first copy (somefile.cpp). After editing all the files you need to edit in this fashion, enter the directory one level above where your source code resides, and then type $ gendiff somedirectory .fix > mydiff-fix.patch You should redirect the output to a file (as illustrated) unless you want to see the results on stdout. SEE ALSO
diff(1), patch(1) AUTHOR
Marc Ewing <marc@redhat.com> 4th Berkeley Distribution Mon Jan 10 2000 GENDIFF(1)
All times are GMT -4. The time now is 10:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy