Когда синтаксический анализ командной строки был впервые представлен в оболочке?

Другое решение sed

echo "-X-1.5" | sed 's/-//2'

Заменить второе вхождение - пустым.

0
16.05.2018, 20:12
1 ответ

Cuando se creó el primer shell en 1971. La página del manual dice:

When the shell is invoked as a command, it has additional string processing capabilities. Recall that the form in which the shell is invoked is

sh [ name [ arg1... [ arg9 ] ] ]

The name is the name of a file which will be read and interpreted. If not given, this subinstance of the shell will continue to read the standard input file. In the file, character sequences of the form "$n", where n is a digit 0,..., 9, are replaced by the nth argument to the invocation of the shell (arg ). "$0" is replaced by name.

2
28.01.2020, 02:32

Теги

Похожие вопросы