Sada je: 10 pro 2019, 00:17.
Razmjena savjeta i trikova o podešavanju sustava i programa.

Moderator/ica: Moderatori/ce

demaxfa je napisao/la:cim sam copy pastao i pokrenu ./ren izbacio mi je ovu grešku nakon toga sam probao zamjeniti " sa ' i ' sa " i urznim kombinacijam ali je svaki put javljao drug grešku


1. Imaš li #!/bin/bash na početku skripte?
2. Jesi li stavio +x (exec) ovlasti nad fajlom (chmod +x ren)?

Ja sam sad probao preko skripte i meni radi...
A neutron walks into a bar; he asks the bartender, 'How much for a beer?' The bartender looks at him, and says 'For you, no charge.'
Avatar
Moderator
Postovi: 4059
Moderator
Postovi: 4059
Pridružen/a: 15 svi 2008, 18:05
Lokacija: Hamburg, DE
Podijelio/la zahvalu: 111 puta
Primio/la zahvalu: 183 puta
Spol: M
OS: Fedora/KDE
1.da
2.da
Postovi: 34
Postovi: 34
Pridružen/a: 17 ožu 2012, 09:27
Podijelio/la zahvalu: 1 puta
Primio/la zahvalu: 2 puta
Stavi kopiju skripte sa izmjenama ovdje,
nekak je teško debagirat nešto što ne vidiš, svaki vjernik ti to može potvrditi :D
To all you "rvacki pravopis" haters, we're gona blow your planet up
we got death star(death star)
and you know that we got it(death star)

Darth Spellingius :D
Avatar
Postovi: 125
Postovi: 125
Pridružen/a: 03 ožu 2011, 18:18
Lokacija: Zagreb
Podijelio/la zahvalu: 2 puta
Primio/la zahvalu: 6 puta
Spol: M
OS: mint14Cina/Centos6
Probaj dodati -print0 kod find-a i -0 kod prvog xargs-a... Iako ne znam hoće li ti to pomoći. Probaj također debugirati skriptu tako da je prvo pokreneš do prvog "|" (pajpa), pa onda do drugog.
A neutron walks into a bar; he asks the bartender, 'How much for a beer?' The bartender looks at him, and says 'For you, no charge.'
Avatar
Moderator
Postovi: 4059
Moderator
Postovi: 4059
Pridružen/a: 15 svi 2008, 18:05
Lokacija: Hamburg, DE
Podijelio/la zahvalu: 111 puta
Primio/la zahvalu: 183 puta
Spol: M
OS: Fedora/KDE
Kod: Označi sve
#!/bin/bash
# renames.sh
# basic file renamer
   
 

find . -type f -name "*.mhtml" -o  -type f -name "*.mht" | xargs -I item sh -c '{ echo item; echo item | sed "s/[:?|]//g"; }' | xargs -n2 mv


nakonon ponovnog copy pastea javlja drugu grešku valjda nešto nisam dobro pastao.


./ren
xargs: unmatched jednostruki quote; by default quotes are special to xargs unless you use the -0 option
sh: 1: sh: 1: Temash.html.mht: not foundAMD’s: not found

sh: 1: sh: 1: AMD’s: not foundTemash.html.mht: not found

mv: missing file operand
Try `mv --help' for more information.
darko@debian:~/Web$
Postovi: 34
Postovi: 34
Pridružen/a: 17 ožu 2012, 09:27
Podijelio/la zahvalu: 1 puta
Primio/la zahvalu: 2 puta
Probao sam redirectati output od ./ren > debug.txt ali neće ispistti dump u file???
Darko
Postovi: 34
Postovi: 34
Pridružen/a: 17 ožu 2012, 09:27
Podijelio/la zahvalu: 1 puta
Primio/la zahvalu: 2 puta
Cuj andi koristis li irc ili skype? skyp mi je darmati3.
Postovi: 34
Postovi: 34
Pridružen/a: 17 ožu 2012, 09:27
Podijelio/la zahvalu: 1 puta
Primio/la zahvalu: 2 puta
Kod: Označi sve
 ./ren > debug.txt
sh: 1: Linux: not found
sh: 1: Linux: not found
sh: 1: Linux: not found
sh: 1: Linux: not found
sh: 1: Linux: not found
sh: 1: Linux: not found
sh: 1: Linux: not found
sh: 1: Linux: not found
mv: target `«' is not a directory
mv: target `a' is not a directory
mv: target `Information' is not a directory
mv: sh: 1: Syntax error: "(" unexpected (expecting "}")
target `Technical' is not a directory
mv: target `on' is not a directory
mv: target `a' is not a directory
mv: target `reviews' is not a directory
mv: target `Ars' is not a directory
mv: target `history' is not a directory
mv: target `Ars' is not a directory
mv: target `5' is not a directory
mv: target `of' is not a directory
mv: target `Ars' is not a directory
mv: target `3' is not a directory
mv: target `history' is not a directory
mv: target `1' is not a directory
mv: target `part' is not a directory
mv: target `Amige/Shadow' is not a directory
mv: target `2' is not a directory
mv: target `an' is not a directory
mv: target `history' is not a directory
mv: target `Ars' is not a directory
mv: target `4' is not a directory
mv: target `of' is not a directory
mv: target `Technica.html.mht' is not a directory
mv: target `postlaunch' is not a directory
mv: target `the' is not a directory
mv: target `Technica.html.mht' is not a directory
mv: target `stopping' is not a directory
mv: target `Ars' is not a directory
mv: target `alive!' is not a directory
mv: target `Amige/A' is not a directory
mv: target `4' is not a directory
mv: target `part' is not a directory
sh: 1: Ars: not found
mv: sh: 1: Ars: not found
target `history' is not a directory
mv: target `Ars' is not a directory
mv: target `4' is not a directory
mv: target `of' is not a directory
mv: sh: 1: Ars: not found
target `./Razno/Povijest' is not a directory
sh: 1: Ars: not found
mv: target `1' is not a directory
mv: target `part' is not a directory
mv: target `Amige/A' is not a directory
mv: target `prototype' is not a directory
mv: target `AmigaOS' is not a directory
mv: target `reviews' is not a directory
mv: target `of' is not a directory
mv: target `Technica.html.mht' is not a directory
mv: target `Enter' is not a directory
mv: target `the' is not a directory
mv: target `Technica.html.mht' is not a directory
mv: target `stopping' is not a directory
mv: target `of' is not a directory
mv: target `3' is not a directory
mv: target `part' is not a directory
mv: target `./Razno/Povijest' is not a directory
mv: target `birth' is not a directory
mv: target `of' is not a directory
mv: target `1' is not a directory
mv: target `part' is not a directory
mv: target `of' is not a directory
mv: target `./Razno/Povijest' is not a directory
mv: target `retrospective' is not a directory
mv: target `Beast' is not a directory
mv: target `Amige/A' is not a directory
mv: target `bleeding' is not a directory
mv: target `Amiga,' is not a directory
mv: target `./Razno/Povijest' is not a directory
mv: target `Technica.html.mht' is not a directory
mv: target `Ars' is not a directory
mv: target `Amiga' is not a directory
mv: target `the' is not a directory
mv: target `Technica.html.mht' is not a directory
mv: target `Game' is not a directory
mv: target `the' is not a directory
mv: target `./Razno/Povijest' is not a directory
mv: target `on!' is not a directory
mv: target `Amiga,' is not a directory
mv: target `Amige/It’s' is not a directory
mv: target `./Razno/Povijest' is not a directory
mv: target `Technica.html.mht' is not a directory
mv: target `Genesis' is not a directory
mv: target `Amiga,' is not a directory
mv: target `history' is not a directory
mv: target `3' is not a directory
mv: target `part' is not a directory
mv: target `Amige/A' is not a directory
mv: target `scene' is not a directory
mv: target `Amiga,' is not a directory
mv: target `./Razno/Povijest' is not a directory
mv: target `retrospective' is not a directory
mv: target `Beast' is not a directory
mv: target `Amige/A' is not a directory
mv: target `3' is not a directory
mv: target `part' is not a directory
mv: target `history' is not a directory
mv: target `4' is not a directory
mv: target `part' is not a directory
mv: target `Amige/A' is not a directory
mv: target `4' is not a directory
mv: target `part' is not a directory
mv: target `history' is not a directory
mv: target `Ars' is not a directory
mv: target `7' is not a directory
mv: target `Ars' is not a directory
mv: target `alive!' is not a directory
mv: target `Amige/A' is not a directory
mv: target `Ars' is not a directory
mv: target `1' is not a directory
mv: target `Everything' is not a directory
mv: target `Place' is not a directory
mv: target `Medium.html.mht' is not a directory
darko@debian:~/WebReaper$
Postovi: 34
Postovi: 34
Pridružen/a: 17 ožu 2012, 09:27
Podijelio/la zahvalu: 1 puta
Primio/la zahvalu: 2 puta
Koliko vidim ovaj one liner ima problem sa fajlovima koji imaju pipe simbol "|" u nazivu.
To all you "rvacki pravopis" haters, we're gona blow your planet up
we got death star(death star)
and you know that we got it(death star)

Darth Spellingius :D
Avatar
Postovi: 125
Postovi: 125
Pridružen/a: 03 ožu 2011, 18:18
Lokacija: Zagreb
Podijelio/la zahvalu: 2 puta
Primio/la zahvalu: 6 puta
Spol: M
OS: mint14Cina/Centos6
Par navodnika riješilo stvar.

Kod: Označi sve
#!/bin/bash

find . -type f -name "*.mhtml" -o  -type f -name "*.mht" | xargs -t -n 10 -I item sh -c '{ echo "item"; echo "item" | sed "s/[:?\|]//g"; }'| xargs -n2 mv



E da, ako hoćeš izbaciti verbosity iz xargs komande onda makni "-t" opciju.
To all you "rvacki pravopis" haters, we're gona blow your planet up
we got death star(death star)
and you know that we got it(death star)

Darth Spellingius :D
Avatar
Postovi: 125
Postovi: 125
Pridružen/a: 03 ožu 2011, 18:18
Lokacija: Zagreb
Podijelio/la zahvalu: 2 puta
Primio/la zahvalu: 6 puta
Spol: M
OS: mint14Cina/Centos6

Na mreži
Trenutno korisnika/ca: / i 1 gost.