devel@ where you _can_ ask
 help / color / mirror / Atom feed
* [newbies]  передача параметров в awk ... или как по другому
@ 2010-03-06 18:33 Vladimir A. Svyatoshenko
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Vladimir A. Svyatoshenko @ 2010-03-06 18:33 UTC (permalink / raw)
  To: devel-newbies

Доброго времени дня,

Стоит несложная задача:
Есть свалка файлов и есть books.csv файл в котором один столбец md5
хеши файлов, а второй - путь и имя куда его положить.
Необходимо раскидать файлы, которые есть в books.csv, по
заданным местам с заданными именами.

Начал писать скрипт. Просто раскидать получилось быстро, а вот с
проверкой по books.csv ну никак не получается. Переменная tmp ну никак
не передается ... или передается, но что то не то :(

#!/bin/bash

for f in *
do
   tmp=`md5sum "$f" | awk '{print $1}'`
   awk '{if($1 != $tmp) print $2}' ~/bookы.csv
#  mv "$f" /mnt/hash/`md5sum "$f" | awk '{print $1}'`
done

В чем я ошибаюсь?


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-06 19:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-06 18:33 [newbies] передача параметров в awk ... или как по другому Vladimir A. Svyatoshenko
2010-03-06 18:40   ` [newbies] Fwd: " Slava Semushin
2010-03-06 19:50     ` Vladimir A. Svyatoshenko
2010-03-06 18:41 ` [newbies] " Andrey Rahmatullin
2010-03-06 19:34 ` Afanasov Dmitry

devel@ where you _can_ ask

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel-newbies/0 devel-newbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel-newbies devel-newbies/ http://lore.altlinux.org/devel-newbies \
		devel-newbies@lists.altlinux.org devel-newbies@lists.altlinux.ru devel-newbies@lists.altlinux.com
	public-inbox-index devel-newbies

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel-newbies


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git