![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to exclude the GREP command from GREP | yamsin789 | UNIX for Advanced & Expert Users | 2 | 10-05-2007 02:59 AM |
| Sun's 'Project Copy Linux' not a Linux copy - Register | iBot | UNIX and Linux RSS News | 0 | 07-29-2007 05:31 AM |
| How to copy ? | nani_ynm | UNIX for Dummies Questions & Answers | 4 | 01-09-2007 05:14 AM |
| Make grep -c display like grep -n? | Jerrad | Shell Programming and Scripting | 2 | 08-25-2006 12:20 AM |
| Copy iso | faron17 | UNIX for Dummies Questions & Answers | 1 | 06-22-2005 08:36 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
You can't pipe cp to grep, that doesn't make sense. A pipeline takes the output from one command and feeds it as input to the next. So the output from cp is what you grep -- that's not what you want.
Where is the destination directory; is that test? You want to copy all files which match the input pattern? Code:
cp `grep -l get *` test Code:
grep -l get * | xargs -i cp {} test
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|