00:00.09 | j0nr | '16\ Over\ And\ Over\ Again.m4a' |
00:01.02 | Discordian | hmm i wonder why cp is grumbling then |
00:02.22 | j0nr | remove quotes, same issue |
00:03.08 | Discordian | On anything serious I've worked on spaces in filenames are a remove user issue |
00:03.47 | Discordian | but media files tend to have em |
00:05.02 | j0nr | so, quotes dont work, escaping spaces dont work...both combined dont work |
00:05.47 | Discordian | see what wetherin said above |
00:06.06 | Discordian | you've got the skills now |
00:06.26 | Discordian | you'll have to experiment |
00:07.02 | j0nr | indeed i will.... |
00:07.10 | j0nr | thank you for your time... i really appreciate it |
00:11.15 | j0nr | it doesnt make sense.. if i just individually run mv 'filename' destination it works... so single quotes without escaping spaces works in the mv command on its ow |
00:11.19 | j0nr | n |
00:12.11 | j0nr | its as if it isnt recognising the `cat list` as one item per line... |
00:12.34 | Discordian | you cat list to see |
00:13.18 | j0nr | i am using : for file in `cat m4aleft` ;do cp "$file" leftovers/ ; done |
00:14.13 | Discordian | maybe you need " instead of ' in the list |
00:15.27 | j0nr | erm... how do i sed 's/$'/"/g' |
00:15.35 | wethrin | IFS="\n" for file in `cat m4aleft`; do cp "$file" leftovers/ ; done |
00:15.35 | j0nr | too many quotes i hink |
00:16.09 | Discordian | ahh those pesky newlines |
00:16.21 | wethrin | And the pesky spaces |
00:16.54 | Discordian | bring back sysfs 14 chars max |
00:16.56 | j0nr | what is IFS="\n"? something to do with newlines |
00:17.11 | Discordian | \n is newline |
00:17.22 | Discordian | line feed |
00:17.28 | wethrin | 8 characters is enough for anyone! |
00:17.48 | wethrin | IFS = Internal Field Separator |
00:17.53 | Discordian | input field seperator |
00:18.02 | Discordian | wot he said |
00:18.06 | j0nr | unexpected tokens? |
00:18.09 | j0nr | I did |
00:18.17 | *** join/#gllug nixofortune_ (n=egor@87.127.26.43) |
00:18.54 | j0nr | bash: syntax error near unexpected token `do' |
00:20.31 | wethrin | that shouldn't happen |
00:20.37 | Discordian | pulling teeth is easier than this |
00:20.46 | j0nr | heh |
00:21.27 | j0nr | what about cat list | xargs something or other? |
00:21.31 | Discordian | what shell are you using? |
00:22.09 | wethrin | j0nr: If you convert the newlines to NULs, you could get away with it |
00:22.10 | wethrin | BUT |
00:22.27 | j0nr | bash i think... |
00:22.28 | wethrin | xargs puts the thingy at the end of the command |
00:22.40 | wethrin | Whereas that's not what you want with cp |
00:24.20 | wethrin | So you could have a little shell script along the lines of: |
00:24.26 | wethrin | #!/bin/sh |
00:24.28 | wethrin | DEST=$1 |
00:24.31 | wethrin | shift |
00:24.40 | wethrin | cp $* $DEST |
00:24.42 | wethrin | <PROTECTED> |
00:24.52 | wethrin | And do: |
00:25.24 | wethrin | cat list | tr "\n" "\0" | xargs -0 ./mycp |
00:25.32 | wethrin | cat list | tr "\n" "\0" | xargs -0 ./mycp leftovers/ |
00:25.35 | wethrin | (even) |
00:26.00 | wethrin | Might need "\000" |
00:26.16 | nixofortune_ | wethrin: you should start online bash classes :) |
00:26.45 | j0nr | whats the DEST for? |
00:26.54 | *** join/#gllug nixofortune (n=egor@87.127.26.43) |
00:26.54 | wethrin | Destination directory |
00:28.03 | j0nr | am i putting my own destinnation directory in there or literally DEST |
00:28.25 | wethrin | Well. |
00:28.36 | wethrin | If you just literally DEST, it's more flexible |
00:28.47 | wethrin | You could just hardcode your destination, so it'd be: |
00:28.53 | wethrin | #!/bin/sh |
00:28.58 | wethrin | cp $* leftovers/ |
00:28.58 | wethrin | <PROTECTED> |
00:29.04 | wethrin | And then |
00:29.09 | wethrin | cat list | tr "\n" "\0" | xargs -0 ./mycp leftovers/ |
00:30.38 | j0nr | do i need a done or something at the end? |
00:30.44 | wethrin | No |
00:31.04 | j0nr | so how is that working? |
00:31.51 | wethrin | It uses NUL as a separator, rather than spaces |
00:32.21 | j0nr | cp: missing destination file operand after `leftovers/' |
00:32.42 | wethrin | hm |
00:33.53 | j0nr | whats the ./mycp? |
00:34.45 | Discordian | you need to 'export DEST' |
00:35.06 | wethrin | It's the script I pasted above |
00:35.27 | j0nr | aye so do i just stick it in |
00:35.32 | j0nr | as you wrote it |
00:35.45 | wethrin | Yes |
00:35.46 | j0nr | just thought it might be referring to some location |
00:36.49 | j0nr | ... cant you just cp "cat m4aleft" leftovers/ |
00:36.52 | j0nr | if you know what i mean |
00:37.27 | wethrin | It'd be nice. But having spaces in filenames is troublesome |
00:37.41 | wethrin | Otherwise it'd be a lot easier |
00:39.15 | j0nr | even surrounded by quotes? |
00:40.15 | wethrin | yeah |
00:44.11 | j0nr | right... getting too tired now |
00:44.28 | j0nr | thank you ever so much for your help... no doubt i will return to bug you more soon :) |
00:46.05 | Discordian | a more radical solution would have involved editing the directory and s/ /_/g |
00:49.15 | j0nr | exec < listoffiles |
00:49.15 | j0nr | while read x ; do somecommand "$x" |
00:49.18 | j0nr | done |
00:49.33 | j0nr | hmm tahat nearly worked.... it read each line as a whole...but then got: |
00:49.48 | j0nr | cp: missing destination file operand after `"20 Days Like This.m4a"' |
00:50.03 | j0nr | somecommand = cp |
00:50.21 | j0nr | hmm where do i sepcify the destination in that? |
00:50.34 | Discordian | because the filename has a " inside it |
00:51.10 | j0nr | yup just spotted that |
00:51.15 | Discordian | which matches the " of "$x |
00:52.06 | Discordian | still it's the way to learn |
00:52.25 | j0nr | looking promising |
00:52.32 | j0nr | what is exec anyway? |
00:53.27 | Discordian | overlays the process with it's child |
00:53.54 | Discordian | source rather than exec is what you want |
00:54.04 | j0nr | seems to be working... |
00:55.16 | j0nr | i dont know how |
00:56.03 | Discordian | executing in a subshell |
00:56.55 | j0nr | got there in the end :) |
00:56.56 | j0nr | thank you |
00:57.04 | j0nr | right definately good night this time |
00:57.37 | Discordian | night |
02:40.45 | *** join/#gllug boudicca (n=boudicca@88-108-93-143.dynamic.dsl.as9105.com) |
02:41.02 | Discordian | wb |
04:44.30 | *** join/#gllug z00dax_ (n=kbsingh@tantra.karan.org) |
04:47.01 | Discordian | wb |
05:49.56 | morsing | z00dax_! |
05:50.00 | morsing | boudicca! |
06:27.45 | *** join/#gllug Leeds (n=richardc@n219073033070.netvigator.com) |
06:32.49 | morsing | Leeds! |
08:48.55 | *** join/#gllug sabinef72 (n=sabinef7@ns.popipo.fr) |
11:05.24 | morsing | sabinef72! |
11:44.22 | morsing | Anyone awake? |
12:14.23 | *** join/#gllug Provito (n=Provito@pdpc/supporter/sustaining/Provito) |
12:16.59 | morsing | Provito! |
12:25.39 | morsing | boudiccas! |
12:56.59 | morsing | Beer |
13:14.38 | boudiccas | snuff |
13:19.21 | morsing | Foot long chilli dog |
13:19.27 | morsing | z00dax! |
13:49.41 | mindbendr | morning |
13:50.07 | mindbendr | http://news.bbc.co.uk/1/hi/wales/7702913.stm |
14:24.22 | *** join/#gllug sabinef72 (n=sabinef7@ns.popipo.fr) [NETSPLIT VICTIM] |
14:24.22 | *** join/#gllug j0nr (n=j0nr@5acc9dcc.bb.sky.com) [NETSPLIT VICTIM] |
14:24.22 | *** join/#gllug mikejw_ (n=mike@falcor.vm.bytemark.co.uk) [NETSPLIT VICTIM] |
14:24.22 | *** join/#gllug cpufreak (n=cpu@nurburgr.ing.me.uk) [NETSPLIT VICTIM] |
14:24.22 | *** join/#gllug pawel (i=t0tal@ep09.pld-linux.org) [NETSPLIT VICTIM] |
14:24.22 | *** join/#gllug antiphase (n=ant@plasma.ossified.net) [NETSPLIT VICTIM] |
14:41.00 | *** join/#gllug blight__ (n=blight@83.244.128.126) |
14:41.04 | *** join/#gllug blight (n=blight@droid.gotadsl.co.uk) |
15:12.38 | *** join/#gllug catalyst (n=catalyst@allegro/user/angelchild) |
15:15.41 | *** join/#gllug slemarie (n=slemarie@87-194-54-71.bethere.co.uk) |
15:16.32 | slemarie | sneaks in |
15:17.43 | morsing | slemarie! |
15:17.47 | morsing | catalyst! |
15:19.04 | slemarie | I'm only here to convert you all to Maclaren supporters for the next few hours.. |
15:19.25 | slemarie | They use penguins, cheer for them! |
15:29.42 | *** join/#gllug boudicca (n=boudicca@88-108-20-177.dynamic.dsl.as9105.com) |
16:28.25 | *** join/#gllug blight (n=blight@droid.gotadsl.co.uk) |
16:41.12 | *** join/#gllug Stephmw (n=steph@host81-152-201-15.range81-152.btcentralplus.com) |
16:45.50 | morsing | blight! |
16:45.52 | morsing | Stephmw! |
16:54.55 | *** join/#gllug Discordian (n=clive@chills.demon.co.uk) |
18:49.18 | *** join/#gllug dick_turpin (n=dick_tur@dsl82-163-112-79.as15444.net) |
18:49.34 | morsing | dick_turpin |
18:49.35 | morsing | ! |
18:57.57 | *** part/#gllug dick_turpin (n=dick_tur@dsl82-163-112-79.as15444.net) |
20:14.10 | *** join/#gllug Stephmw (n=steph@host81-152-201-15.range81-152.btcentralplus.com) |
20:15.39 | morsing | Stephmw! |