Использование для этого метода извлечения имени файла удара?

Я создал проект test maven с использованием вашего кода, а затем импортировал его в Eclipse, и все работает нормально, как только вы измените 3035 на EPSG:3035.

Я бы проверил, что вы не находитесь в автономном режиме, когда вы обновляете проект maven, чтобы убедиться, что банки загружены.

9
задан jjclarkson 21 January 2010 в 15:51
поделиться

5 ответов

Это избавляется от расширения файла (здесь: .tif), образец:

$ for A in test.py test.sh test.xml test.xsl; do echo "$A: ${A%%.*}"; done
test.py: test
test.sh: test
test.xml: test
test.xsl: test

из руководства удара:

   ${parameter%%word}
          The word is expanded to produce a pattern just as in pathname expansion.  If the
          pattern matches a trailing portion of the expanded value of parameter, then  the
          result  of  the  expansion  is the expanded value of parameter with the shortest
          matching pattern (the ``%'' case) or the longest matching  pattern  (the  ``%%''
          case) deleted.  If parameter is @ or *, the pattern removal operation is applied
          to each positional parameter in turn, and the expansion is the  resultant  list.
          If  parameter  is an array variable subscripted with @ or *, the pattern removal
          operation is applied to each member of the array in turn, and the  expansion  is
          the resultant list.
15
ответ дан 4 December 2019 в 08:53
поделиться

Здесь производится из страницы справочника удара

 ${parameter%%word}
          The word is expanded to produce a pattern just  as  in  pathname
          expansion.   If  the  pattern  matches a trailing portion of the
          expanded value of parameter, then the result of the expansion is
          the  expanded value of parameter with the shortest matching pat-
          tern (the ``%'' case)  or  the  longest  matching  pattern  (the
          ``%%''  case)  deleted.   If  parameter  is  @ or *, the pattern
          removal operation is applied to  each  positional  parameter  in
          turn,  and the expansion is the resultant list.  If parameter is
          an array variable subscripted with @ or *, the  pattern  removal
          operation  is  applied  to each member of the array in turn, and
          the expansion is the resultant list.
4
ответ дан 4 December 2019 в 08:53
поделиться

Выезд "Расширение Параметра" в страницах справочника удара. Тот синтаксис разворачивает переменную $src, удаляющую материал, который соответствует.* шаблону от него.

1
ответ дан 4 December 2019 в 08:53
поделиться

По-видимому, удар имеет несколько инструментов "Parameter Expansion", которые включают:

Просто замена значением...

${parameter}

Расширение до подстроки...

${parameter:offset}
${parameter:offset:length}

Замените длиной значения параметров...

${#parameter}

Подробно останавливаясь на соответствии в начале параметра...

${parameter#word}
${parameter##word}

Подробно останавливаясь на соответствии в конце параметра...

${parameter%word}
${parameter%%word}

Разворачивает параметр для нахождения и заменения строки...

${parameter/pattern/string}

Это моя интерпретация первых частей, думают, что я понимаю от этого раздела страниц справочника. Сообщите мне, пропустил ли я что-то важное.

3
ответ дан 4 December 2019 в 08:53
поделиться

Это - строковая операция удаления в формате: ${str%%substr}

Где ул. является строкой, Вы воздействуете на, и substr является шаблоном для соответствия. Это ищет самое долгое соответствие substr на ул. и удаляет все из той точки на.

1
ответ дан 4 December 2019 в 08:53
поделиться