我有一个变量${value},它的内容是:
bigint_col, smallint_col,string_col,string_col,string_col, bigint_col, string_col,string_col,timestamp_col,timestamp_col,timestamp_col,timestamp_col
Run Code Online (Sandbox Code Playgroud)
我只想先bigint_col用my_col变量本身替换,以便新内容看起来像这样
my_col, smallint_col,string_col,string_col,string_col, bigint_col, string_col,string_col,timestamp_col,timestamp_col,timestamp_col,timestamp_col
Run Code Online (Sandbox Code Playgroud)
我正在寻找一些帮助来解决这个问题。
echo "${value/bigint_col/my_col}" # outputs contents of $value replacing the first instance of 'bigint_col' with 'my_col'
Run Code Online (Sandbox Code Playgroud)