LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 06-16-2004, 02:33 AM   #1
chakkerz
Member
 
Registered: Dec 2002
Location: Brisbane, Australia
Distribution: RedHat (RHEL, FC, CentOS), openSuSE, Mac OS X
Posts: 653

Rep: Reputation: 32
selective batch copying


Hi

I'm trying to get linux to copy 3 files:
test-2.6.1.txt test-2.6.2.txt & test-2.6.4.txt

of
test-2.6.1.txt test-2.6.2.txt test-2.6.3.txt & test-2.6.4.txt

to a directory (say ./to_backup)

as quickly (efficient in terms of keystrokes)

I was thinking something like:
for f in ./test-2.6.?.txt; do if [ $f != "test-2.6.3" ]; then cp $f ./to_backup fi; done

but that doesn't work telling me that "done" is not expected.

Any idea on what would work, not necessarily like that, but definitely in the console?
 
Old 06-16-2004, 02:36 AM   #2
spurious
Member
 
Registered: Apr 2003
Location: Vancouver, BC
Distribution: Slackware, Ubuntu
Posts: 558

Rep: Reputation: 31
cp test-2.6.{1,2,4}.txt /backup
 
Old 06-16-2004, 02:47 AM   #3
chakkerz
Member
 
Registered: Dec 2002
Location: Brisbane, Australia
Distribution: RedHat (RHEL, FC, CentOS), openSuSE, Mac OS X
Posts: 653

Original Poster
Rep: Reputation: 32
ok ... neat

is there a way of doing the same thing, but by telling it NOT to copy a file

like

cp test-2.6.{!3}.txt /backup

(which doesn't work ... and leads to the question, why does !3 = su??) But something like that maybe?
 
  


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
X selective translucency? shishimo Linux - Software 1 06-22-2005 08:31 PM
protocol selective malfunction? CloudBuilder Linux - Networking 0 03-22-2004 05:36 PM
Selective startup LemonSHARK Red Hat 1 03-02-2004 06:25 PM
How selective is your memory? xailer Linux - Newbie 12 12-04-2003 12:36 AM
Mac Selective Startup? Brett General 0 11-01-2001 05:10 PM


All times are GMT -5. The time now is 02:16 AM.

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