当我想关闭时gdb
,我经常打错字
quit()
Run Code Online (Sandbox Code Playgroud)
代替
quit
Run Code Online (Sandbox Code Playgroud)
每当发生这种情况时,就会gdb
无限期地挂起,而我最终会使用kill -9 gdb_pid
它来终止它。
我想问一下:
()
影响 的行为gdb
?quit()
为quit
,a patch
,简单地了解为什么()
不好......的版本gdb
是7.11.90.20161005-0ubuntu2
。
I am practicing with parameter substitution in bash.
I wrote the following dummy script:
#!/bin/bash
var1="/some/path/to/file/the_file.arbitrary.n.ext.0.random.ext"
var2="/some/path/to/file/the_file.arbitrary.n.ext.0.ext"
pattern='.[0-9]?(.random).ext'
echo "${pattern}"
echo "${var1/${pattern}/}"
echo "${var2/${pattern}/}"
Run Code Online (Sandbox Code Playgroud)
Basically, the pattern is meant to strip off the last part of the file name.
Executing the dummy script results in:
~$ ./dummy.sh
.[0-9]?(.random).ext
/some/path/to/file/the_file.arbitrary.n.ext.0.random.ext
/some/path/to/file/the_file.arbitrary.n.ext.0.ext
Run Code Online (Sandbox Code Playgroud)
whereas eval
ing the script's contents or, equivalently, the direct input of that sequence of commands in the interactive shell, results in:
~$ eval "$(cat dummy.sh)"
.[0-9]?(.random).ext
/some/path/to/file/the_file.arbitrary.n.ext
/some/path/to/file/the_file.arbitrary.n.ext
Run Code Online (Sandbox Code Playgroud)
The …