Почему bash расширяет историю / восклицательный знак, когда заключен в одинарные кавычки

TCL может читать файл напрямую без усложнения spawn cat:

#!/usr/bin/env expect

# open a (read) filehandle to the "version" file... (will blow up if the file
# is not found)
set fh [open version]
# and this call handily discards the newline for us, and since we only need
# a single line, the first line, we're done.
set VERSION [gets $fh]

# sanity check value read before blindly using it...
if {![regexp {^5\.[0-9]+\.[0-9]+$} $VERSION]} {
    error "version does not match 5.x.y"
}

puts "spawn rpm --addsign dist/foo-$VERSION-1.i686.rpm"
1
23.05.2017, 15:39
0 ответов

Теги

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