tag:blogger.com,1999:blog-11788780.post4559778933127839676..comments2023-12-29T13:22:33.104-08:00Comments on JJinuxLand: UNIX: "cut" Can't Cut Itjjinuxhttp://www.blogger.com/profile/03270879497119114175noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-11788780.post-14339919649327804282008-12-22T16:54:00.000-08:002008-12-22T16:54:00.000-08:00That is an awesome trick, exactly what I was looki...That is an awesome trick, exactly what I was looking for! Why isn't that documented anywhere??Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11788780.post-31022556450482709262008-04-22T02:03:00.000-07:002008-04-22T02:03:00.000-07:00Ah, nice trick. I guess the one constraint is tha...Ah, nice trick. I guess the one constraint is that you have to have the content in a file. I.e. you can't pipe it in.<BR/><BR/>Heh, that's the first time I've seen someone actually use paste. I saw the man page, but for some reason, I've never seen anyone use it. I also didn't know about the <( ) syntax. Man, I feel like a total shell newb today.<BR/><BR/>It's funny that what UNIX calls "paste", Python calls "zip".jjinuxhttps://www.blogger.com/profile/03270879497119114175noreply@blogger.comtag:blogger.com,1999:blog-11788780.post-10793361480534565892008-04-15T13:30:00.000-07:002008-04-15T13:30:00.000-07:00You can get the same effect using a combination of...You can get the same effect using a combination of cut and paste:<BR/><BR/>$ cat tmp<BR/>1 2 3<BR/>a b c<BR/><BR/>$ paste <(cut -f 2,3 tmp) <(cut -f 1 tmp)<BR/>2 3 1<BR/>b c aDave Kirbyhttps://www.blogger.com/profile/05692608289845036146noreply@blogger.com