LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-30-2010, 02:57 PM   #1
hyperfluid
Member
 
Registered: Aug 2010
Location: /ger/nrw/ac
Distribution: Ubuntu 12.04
Posts: 34

Rep: Reputation: Disabled
What does the following shell script expression mean?


Hey there,

I've found the following script to copy files specified by a find output into a target directory.

Code:
find $SOURCE -name "*.avi" | xargs -i cp -v {} $TARGET
What exactly does the colored expression mean? Does it refer to an array?
 
Old 11-30-2010, 03:30 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux, LFS, Slitaz
Posts: 3,075
Blog Entries: 1

Rep: Reputation: 975Reputation: 975Reputation: 975Reputation: 975Reputation: 975Reputation: 975Reputation: 975Reputation: 975
Quote:
Originally Posted by hyperfluid View Post
Hey there,

I've found the following script to copy files specified by a find output into a target directory.

Code:
find $SOURCE -name "*.avi" | xargs -i cp -v {} $TARGET
What exactly does the colored expression mean? Does it refer to an array?
Thats just a copypasta kind of error you get when copy pasting from HTML pages. { = { and } = } The command should be:


Code:
find $SOURCE -name "*.avi" | xargs -i cp -v {} $TARGET
You might want to go through that entire script and make sure there are no more of those conversion errors.

Last edited by szboardstretcher; 11-30-2010 at 03:32 PM.
 
1 members found this post helpful.
Old 11-30-2010, 03:51 PM   #3
hyperfluid
Member
 
Registered: Aug 2010
Location: /ger/nrw/ac
Distribution: Ubuntu 12.04
Posts: 34

Original Poster
Rep: Reputation: Disabled
Thank you!
It was driving me crazy, that I've found nothing on this.
 
Old 11-30-2010, 03:55 PM   #4
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
FWIW, also note that eventually the -i option will maybe one day disappear. It's deprecated according to the xargs man page, which reads:
Quote:
This option is deprecated; use -I instead (that is an upper-case 'eye').
 
  


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
Executing a Shell script with 654 permissions inside another shell script. changusee2k Linux - Newbie 2 06-07-2011 07:58 PM
bourne shell pattern matching or regular expression powah Programming 2 06-30-2006 10:27 AM
bash shell script expression CowboyJ Programming 2 04-24-2005 11:33 PM


All times are GMT -5. The time now is 06:38 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration