ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Its an old topic .. but still there is built ins in most shells
arg="USER|PASSWORD"
echo ${arg/*|/ }
echo ${arg/|*/ }
PASSWORD
USER
Hello,
Please don't dig up very old threads like this. If you have an issue, search the forums first, and if that doesn't help, then by all means create a new thread for your issue.
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 9,110
Rep:
Actually, in cases like this I think what Hogdahl did was acceptable. The topic in question really isn't time sensitive and someone finding this thread via Google could certainly benefit from the answer provided.
Actually, in cases like this I think what Hogdahl did was acceptable. The topic in question really isn't time sensitive and someone finding this thread via Google could certainly benefit from the answer provided.
--jeremy
Point taken... I just find it odd, since the last post was back in 2001.
This is easier. just replace whats in the []s in the sed command
In this case i was splitting an IP. the "period" has to go first in the []s. I needed to escape the / so i had to put \/. But you could split on anything with sed. tr will also split but not very well here since i needed . and /
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.