let bear = await question('what kind of bear is best? ')let token = await question('choose env variable: ', { choices: object.keys(process.env)}) 在第二个参数中,可以指定选项卡自动完成的选项数组 以下是接口定义 function question(query?: string, options?: questionoptions): promise<string>...
/bin/bash #Declare bash string variable BASH_VAR="Bash Script" # echo variable BASH_VAR echo $BASH_VAR #when meta character such us "$" is escaped with "\" it will be read literally echo \$BASH_VAR # backslash has also special meaning and it can be suppressed with yet another "\"...
-T string Replace the default HTML title and H1 header with string. -R Rerun tree when max dir level reached. -o file Output to file instead of stdout. --inodes Print inode number of each file. --device Print device ID number to which each file belongs. --noreport Turn off file/dir...
shell.cd('lib');shell.ls('*.js').forEach(function(file){shell.sed('-i','BUILD_VERSION','v0.1.2',file);shell.sed('-i',/^.*REMOVE_THIS_LINE.*$/,'',file);shell.sed('-i',/.*REPLACE_LINE_WITH_MACRO.*\n/,shell.cat('macro.js'),file);});shell.cd('..');# 除非另有说...
[,IX] Load window icon from file, optionally with index-l,--log FILE|- Log output to file or stdout-o,--option OPT=VAL Override config file option with given value-p,--position X,Y Open window at specified coordinates-s,--size COLS,ROWS Set screen size in characters-t,--title ...
Used in filename expansion and string manipulation. <( ) It is very similar to a pipe and used for process substitution. { } Used to expand sequences. ${ } Used for string manipulation and variable interpolation. | Used to run multiple commands together.| > Used to send output to a fi...
for i in "$@"; do [[ $i ]] && IFS=" " tmp_array["${i:- }"]=1 done printf '%s\n' "${!tmp_array[@]}" } 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 用法示例: $ remove_array_dups 1 1 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 5 ...
-T string Replace the default HTML title and H1 header with string. -R Rerun tree when max dir level reached. -o file Output to file instead of stdout. --inodes Print inode number of each file. --device Print device ID number to which each file belongs. ...
('*.js').forEach(function (file) {shell.sed('-i', 'BUILD_VERSION', 'v0.1.2', file);shell.sed('-i', /^.*REMOVE_THIS_LINE.*$/, '', file);shell.sed('-i', /.*REPLACE_LINE_WITH_MACRO.*\n/, shell.cat('macro.js'), file);});shell.cd('..');# 除非另有说明,否则...
${string/pattern/replacement} It matches the pattern in the variable $string, and replace only the first match of the pattern with the replacement. $catfirstmatch.sh#! /bin/bash filename="bash.string.txt"echo"After Replacement:"${filename/str*./operations.} ...