I have to write a script in Linux, that takes input from user.
For example, this could be a line of input:
name = Ruba
I need to take the "Ruba" from the input, so how can i split the input and take the last part?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use
IFSin bash, which is the “internal field separator” and tells bash how to delimit words. You can read your input in withIFSset to a space (or whatever delimiter) and get an array back as input.Test run: