我有一个变量${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
我只想先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
我正在寻找一些帮助来解决这个问题。
echo "${value/bigint_col/my_col}" # outputs contents of $value replacing the first instance of 'bigint_col' with 'my_col'
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句