Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

bash xargs script

Name: Anonymous 2008-06-01 12:02

i'm working in a bash script that writes id3 tags to some files i have that don't have id3 tags, just the filename with the song's name. these specific files have a format, which is
(number)(number) - (song name)(2).mp3
so i made this:
for i in * ; do e=`echo $i | sed -e 's/\ /\\\\ /g;s/(/\\\\(/g;s/)/\\\\)/g'` ; echo $i | grep -i [0-9][0-9] | sed s/^[0-9][0-9]\ -\ //g\;s/\(.*//g | sed s/\ $//g | xargs -I {} echo id3 -a Mecano -t \"{}\" $e ; done

it outputs this:

id3 -a Mecano -t "Hoy No Me Puedo Levantar" 01\ -\ Hoy\ No\ Me\ Puedo\ Levantar\ \(2\).mp3
id3 -a Mecano -t "No Me Enseñen La Lección" 02\ -\ No\ Me\ Enseñen\ La\ Lección\ \(2\).mp3

which is exactly what i want to execute. now, when i remove the echo and actually execute it, it gives me

id3: no files matching 01\
id3: no files matching -\
id3: no files matching Hoy\
id3: no files matching No\
id3: no files matching Me\
id3: no files matching Puedo\
id3: no files matching Levantar\
id3: no files matching \(2\).mp3
id3: no files matching 02\
id3: no files matching -\
id3: no files matching No\
id3: no files matching Me\
id3: no files matching Enseñen\
id3: no files matching La\
id3: no files matching Lección\
id3: no files matching \(2\).mp3

any help?

Name: Anonymous 2008-06-01 12:08

Mecano
ergo your wrong bitch

Name: Anonymous 2008-06-01 12:09

PROTIP: The receiving end should be xargs -0. Figure out the rest.

Name: Anonymous 2008-06-01 12:23

MY AUTOCS DONT NEED LICKING

Name: Anonymous 2008-06-01 12:53

>>3
i tried several ways. i can't. i need someone to help me.
i'm not a programmer, i'm just a hobbyist. i really don't know how to do this. i tried with tr replacing newlines with null characters, but i don't even know if that's what i need.

Name: Anonymous 2008-06-01 13:15

for my $file (glob '*.mp3') {
    my ($name) = $file =~ /^[0-9]{2} - (.*) \(2\)\.mp3$/ or next;
    system qw(id3 -a Mecano -t), $name, $file;
}

Name: Anonymous 2008-06-01 13:24

>>6
thank you so much.

Name: Anonymous 2008-06-01 17:03

>>6
lrn2sh, perl weenie
for i in *.mp3; do echo id3 -a Mecano -t "`echo "$i" | sed 's/^[0-9][0-9] - \(.*\)(2).mp3/\1/'`" "$i"; done

Name: Anonymous 2008-06-01 18:00

>>4
8/10

Name: Anonymous 2008-06-02 5:04

>>8
lern2sh, sed weenie
for i in *.mp3; do
    j="${i#[0-9][0-9] - }"
    j="${j% (2).mp3}"
    id3 -a Mecano -t "$j" "$i"
done

Name: Anonymous 2008-06-02 7:29

>>10
I figured he may want to use more powerful regexes later. Unless this is just a one-off script.

He should probably be using find -print0 | xargs -0IX sh -c ... anyway.

Name: Anonymous 2008-06-02 7:42

I figured he may want to use more powerful regexes later.
…in which case he should have stuck with Perl.

Name: Anonymous 2009-06-25 15:06

>>12
or lisp

Name: Anonymous 2009-06-25 15:21

>>11
WHY would ANYONE use find and xargs?

Name: Anonymous 2009-06-25 21:23

>>14
Personally, I use them both when haxxing anii

Name: Sgt.Kabukiman뮛 2012-05-23 15:11

All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy

Name: bampu pantsu 2012-05-29 3:41

bampu pantsu

Name: 2013-01-25 18:05

ण愀瀀腤䎗䀖遃咅㌩࠷荰䁃䀢吉艑㙖❶冔घ࢔儣咖Ƙ➆ဓ楥ɇ…颂؃㕹ᠤ㊈⤈ㄇမॅဆᄴ㔥鄗ℑ砣悕≵癥∲啷礕慤霈㑘焙⤨悒鍅ℇ膃攣碐週ᝃ楐砧ᆙ艥⡨硅ķ包䜤碁鐖㡀∵異㘧霘抖⁵璇吔㖘䄇ڗ䌅ႃ䍢⚕㉤奇᎗映䠗ᔅ䥂楱芁蘲啥眹䁳酨倥坶⊂㈧̑‹犘ݹㄴ坹玄㝠坷葧恥用嘇ڒ䥵䂉ᕙ備ࠑ玆ܕ癆悂⥐搢熕虒䘅䄒舀ၡ✓祡ᥕ董ق㠰⦙荅碒ᙔ圴恙塔蕕㌑阀ᑶȡ蠥Δ敗♵妄Љ䡱̶┗᠄䁒疅≓艢閒楣㍓䘀碕蜒琱琖㞀砄֓Ԣ!楥ᤖँ㤓蔲䐂物㉷蚂䌩Ф摥ና㥑ጃᐄ䖇塲戉ʄ㌡䉣砱ပ霃ᚓ這晕㕐䍢员蝖蘴酀敇鄙掔Ж♢ㅶ䠹ࡑ隉ᄸȅ褲祙㍰牄霗Ƃ朗逑ᡣ儘㠳䐨ᆆ㉈☩㉢⦅蔇⒂蕡镩餥╀ᄹ⍙圶጑႖ᄠ㑆㞃葦㡧چ靦塠挩䅷璖脶ᤷ࢘㞔䡒焢鉥▁瘵♇㌇研祘怖錉䤙整ᄀ䍄ࡔኇᚉԈ⍲则ᄡѸ袐ᝧŇ垉敢獉ᡴ蝲襒ٙ隀䀗ܠ牙聂᠐獳ᅸ䥵٠ₒ⠹挑㑖醈ᄩ㔔獹鉗阢靸蕉昨甃㞔陸虢㍲垑䤥ㄆᕅ儴戕桘܃耰䘷茳領ɐ䝹鐂腩Ⅵ╕垙靖袔省≕銘项䑇≦䄕☨塷眆撂㄀聕ࠦ䄄䅨蝗ृ蠷傓⁴〃靆舷逓䀨撁㐧Չ刁瘵偹䁇ၲ⍸扗摐扙琵ፂᜰᙄ栙ጙၗĢᆙ枓倅道的噀椵睈⤲砈硧噤瑥蘂圉ԥ݀ᙣ鄂ƃ䘆☰吀坰硴犄虦攖硈灥劇館腓襨熗㤀奵館憀唤改㍉玄ㄐ顆䝧虱ؑ喗㙑ᖀ灑քܙ饗艕险塶瘦ㅤㄤ肗荗坠ᕑ脧昶儠瞄刦䘄㖔ₑ敔慖琐兲㍉ᖃ㜑❸䂑餖唇奁ᢀ肖䕆昄唗阤【镀恔搲皔⡶祶鐱䅢

Don't change these.
Name: Email:
Entire Thread Thread List