LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-02-2009, 10:32 AM   #1
bioinformatics_guy
Member
 
Registered: Aug 2008
Posts: 54

Rep: Reputation: 15
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.
 
Old 09-02-2009, 11:10 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
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
 
Old 09-02-2009, 11:36 AM   #3
bioinformatics_guy
Member
 
Registered: Aug 2008
Posts: 54

Original Poster
Rep: Reputation: 15
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
please help with cut and paste into .c file henry_huckem Programming 7 01-28-2005 06:37 AM
How do you cut and paste from aterm? patpawlowski Linux - Software 3 02-20-2004 11:16 PM
xmessage cut and paste mlenehan Linux - General 3 06-17-2003 04:27 PM
cut and paste c0c0deuz Linux - Newbie 6 11-01-2001 01:38 PM
cut, copy and paste loganwva Linux - General 1 10-11-2001 02:37 PM


All times are GMT -5. The time now is 12:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration