0

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

1 Answer 1

2

Replace 806 with empty string using this command:

list="${Return_value1/806/}" 

output: 145,606,

Sign up to request clarification or add additional context in comments.

1 Comment

bash has a lot of ways to modify a variable's value when expanding it; see section 3.5.3 (Shell Parameter Expansion) in the bash manual.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.