Solved

Korn Shell String

Posted on 2002-03-22
1
430 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 84

Accepted Solution

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

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
pauing printer deamon in AIX 10 59
ftpcommand 2 59
Unix/bash: scripted arithmetic 13 99
Write an app 10 70
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

805 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