LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   paste, cut one liner conversation from bash to csh (https://www.linuxquestions.org/questions/linux-newbie-8/paste-cut-one-liner-conversation-from-bash-to-csh-752098/)

bioinformatics_guy 09-02-2009 09:32 AM

paste, cut one liner conversation from bash to csh
 
I have the line:

paste <(cut -f3,4 file1) <(cut -f3,4 file2) > foo.txt

Can I do this in csh? It only works in bash.

colucix 09-02-2009 10:10 AM

Nope. Process substitution is a bash feature (and zsh if I remember well). In csh you have to find a workaround to achieve the same task. For example using gawk or nawk:
Code:

nawk '{ printf "%s %s ", $3, $4; getline < "file2"; print $3, $4 }' file1 > foo.txt

bioinformatics_guy 09-02-2009 10:36 AM

Brilliant! Thanks for the reply. I wanted to do it with awk but I couldn't figure out how to pass it multiple files. The problem was, I was making a system command call from perl and thought it was interpreting using csh instead of bash... come to find out, it was interpreting with the "sh" shell :)


All times are GMT -5. The time now is 07:27 PM.