Parse error: syntax error, unexpected '[', expecting T_PAAMAYIM_NEKUDOTAYIM in D:\www\…\blogit.php on line 17
Вначале
Дневник опытного виндузятника, который наконец-то вырос до осознания превосходства Linux над остальными операционными системами. Вот теперь мучаюсь потихоньку... =))
#!/bin/bashОн достаточно резво конвертирует все файлы в текущей директории из windows-1251 (cp1251) в UTF-8:
FILES="./*.php"
for i in $FILES
do
echo "Converting $i to UTF-8 encoding..."
mv $i $i.icv
iconv -f WINDOWS-1251 -t UTF-8 $i.icv > $i
rm -f $i.icv
done
aldekein@Aldekein:~/123$ ./recode
Converting ./add_by_emai2.php to UTF-8 encoding...
Converting ./add_by_email.php to UTF-8 encoding...
Converting ./fs.php to UTF-8 encoding...
Converting ./head.inc.php to UTF-8 encoding...
libbluetooth2_3.7-1_i386.deb
libopenobex1_1.3-3_i386.deb
obexftp_0.19-7_i386.deb
[17189517.828000] usb 2-3: new full speed USB device using ohci_hcd and address 7
[17189518.792000] usbcore: registered new driver usbserial
[17189518.792000] drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
[17189518.796000] usbcore: registered new driver usbserial_generic
[17189518.796000] drivers/usb/serial/usb-serial.c: USB Serial Driver core
[17189518.800000] drivers/usb/serial/usb-serial.c: USB Serial support registered for pl2303
[17189518.804000] pl2303 2-3:1.0: pl2303 converter detected
>>> это >>> 4000] usb 2-3: pl2303 converter now attached to ttyUSB0
[17189518.804000] usbcore: registered new driver pl2303
Receiving "/"... Sending ""... done
folder-listing version="1.0"
folder name="Data" modified="20040101T000000" perm="RWD" perm="W"
folder name="Cache" modified="20040102T000000" perm="RWD" perm="W"
folder name="Config" modified="20040103T000000" perm="RWD" perm="W"
> obexftp -c Data/Pictures -g image01.jpg image02.jpg anim23.gif
> rm /tmp/mobil.txt; for i in `obexftp -c Data/Pictures -l`;\
do name="` echo \"$i\" | grep name | sed 's/"//g' | sed 's/^name=//g' `";\
echo $name >> /tmp/mobil.txt; done; \
echo `cat /tmp/mobil.txt|sed 's/\n//g'` > /tmp/mobil2.txt; sleep 1;\
obexftp -i -c Data/Pictures -g `cat /tmp/mobil2.txt`
#!/bin/bash
for arg
do
obexftp -t /dev/ttyUSB0 -c Data -p "$arg"
sleep 1
done