Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Korn Shell String

Posted on 2002-03-22
1
Medium Priority
?
458 Views
Last Modified: 2010-04-21
I am writting a Korn Shell procedure, in which I have a string variable (name="word1 word2 word3") which consists of several words seperated by spaces. I would like to extract individual words e.g. the second word. Is there a function I could use to do that?
0
Comment
Question by:jc31415
1 Comment
 
LVL 85

Accepted Solution

by:
ozo earned 200 total points
ID: 6890498
name="word1 word2 word3"
set -A a $name
echo ${a[1]}
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question