Sehaj Paul Singh
Sehaj Paul Singh

Reputation: 55

Delete a string from a variable using bash

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

Upvotes: 0

Views: 933

Answers (1)

Mohsen Dehghankar
Mohsen Dehghankar

Reputation: 392

Replace 806 with empty string using this command:

list="${Return_value1/806/}" 

output: 145,606,

Upvotes: 2

Related Questions