Попробуйте следующее:
tail -n +2 $spreadsheet | while IFS=, read -r -a arr; do mv "${arr[@]}"; done
Команда tail печатает только последние строки файла. С «-n +2» он печатает все последние строки файла, начиная со второй.
Подробнее о цикле while. Циклы while запускают команду mv
до тех пор, пока доступны новые строки. Для этого используется условие цикла while:
IFS=, read -r -a arr
Вышеупомянутое считывает одну строку в массив с именем arr
, где разделителем полей (IFS) является запятая. Параметр -r
, скорее всего, не нужен.
Затем при запуске команды mv
"$ {arr [@]}" преобразуется в список полей, где каждое поле разделено двойными кавычками. В вашем случае в каждой строке всего два поля, поэтому он расширен только до двух полей. «$ {Arr [@]}» - это специальное соглашение, используемое bash для массивов, как описано в руководстве:
Any element of an array may be referenced using ${name[subscript]}. The braces are
required to avoid conflicts with pathname expansion. If subscript is @ or *, the
word expands to all members of name. These subscripts differ only when the word
appears within double quotes. If the word is double-quoted, ${name[*]} expands to
a single word with the value of each array member separated by the first character
of the IFS special variable, and ${name[@]} expands each element of name to a sepa-
rate word. When there are no array members, ${name[@]} expands to nothing. If the
double-quoted expansion occurs within a word, the expansion of the first parameter
is joined with the beginning part of the original word, and the expansion of the
last parameter is joined with the last part of the original word. This is analo-
gous to the expansion of the special parameters * and @ (see Special Parameters
above). ${#name[subscript]} expands to the length of ${name[subscript]}. If sub-
script is * or @, the expansion is the number of elements in the array. Referenc-
ing an array variable without a subscript is equivalent to referencing element
zero.
Aparentemente, sshd & nc no se compilaron contra la biblioteca libwrap.a en TCL. Acabo de probar /usr/sbin/sshd
en CentOS y funciona, pero no en TCL.
[root@CentOS ~]# whereis sshd
sshd: /usr/sbin/sshd /usr/share/man/man8/sshd.8.gz
[root@CentOS ~]#
[root@CentOS ~]# ldd /usr/sbin/sshd | grep libwrap
libwrap.so.0 => /lib64/libwrap.so.0 (0x00007f506b6e2000)
[root@CentOS ~]#
http://forum.tinycorelinux.net/index.php/topic,21917.msg137160.html#msg137160