Home > Back-end >  Delete a string from a variable using bash
Delete a string from a variable using bash

Time:06-14

I need to delete string i.e 806 which is returned by a variable

list="${Return_value1}"

which returns values such as "145,606,806", how to delete 806 from the final variable list

CodePudding user response:

Replace 806 with empty string using this command:

list="${Return_value1/806/}" 

output: 145,606,

  • Related