Linux forum

General discussion

split two words

by tarzan11_11 / March 16, 2015 9:55 PM PDT

hi all
How can I split "HELLO WORLD" into "hello" AND "world" by a single command with <space> as delimiter and put in two strings s1 and s2 ..

Discussion is locked
You are posting a reply to: split two words
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: split two words
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Collapse -
Re: split two words
by Kees_B Forum moderator / March 16, 2015 11:14 PM PDT
In reply to: split two words

In Java? In awk? In Korn shell?
Different languages have differnent answers, so please provide a context.

For example, in ABAP (the SAP language) it's SPLIT x AT space INTO part1 part2.. But it could well be you need something else.


Collapse -
In bash shell
by tarzan11_11 / March 24, 2015 8:45 PM PDT
In reply to: Re: split two words

Sry for a delayed reply ..
I need to split in a single command in bash shell


Collapse -
I don't see such a command.
by R. Proffitt Forum moderator / March 25, 2015 12:52 AM PDT
In reply to: In bash shell
Popular Forums
Computer Newbies 10,686 discussions
Computer Help 54,365 discussions
Laptops 21,181 discussions
Networking & Wireless 16,313 discussions
Phones 17,137 discussions
Security 31,287 discussions
TVs & Home Theaters 22,101 discussions
Windows 7 8,164 discussions
Windows 10 2,657 discussions

Does BMW or Volvo do it best?

Pint-size luxury and funky style

Shopping for a new car this weekend? See how the BMW X2 stacks up against the Volvo XC40 in our side-by-side comparison.