LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
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
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
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



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:47 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
Open Source Consulting | Domain Registration