04-05-2007
Using IFS
HTML Code:
#!/bin/ksh
Str=one:two::four
IFS=:
set -A Test $Str
let count=${#Test[@]}
let i=0
while [[ $i -lt $count ]]; do
print "Test[$i] ==> ${Test[$i]}"
((i=i+1))
done
Please check if this solves the problem,
Thanks
Nagarajan Ganesan
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi Experts,
I'm new to Shell Scripting world and need a little help from you "Scripting Gurus".
I want to convert a string (entered by a user) to array in csh. I want something like this:
echo "Enter the Numbers: "
set num = $<
Suppose, user enters:
1 2 3 4 5 6 7
This... (6 Replies)
Discussion started by: sumitgarg
6 Replies
2. UNIX for Advanced & Expert Users
Hello,
I have 2 sun servers. We are running Oracle apps. We have to apply patches to both servers whenever a patch needs to be applied for Oracle.
We use the same username eg. applmgr on both servers. We have a shared patch area which we can run the patch from on both boxes.
the uid for... (2 Replies)
Discussion started by: d__browne
2 Replies
3. Solaris
How do you make the changes take affect when you change the subnet masks or default router without rebooting? (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies
4. Shell Programming and Scripting
hi ,
i want to store variable but i get always error when i excute this command ligne :
var = awk '{print $1}' file1
echo $var
how can i store the var?
thanks (7 Replies)
Discussion started by: kamel.seg
7 Replies
5. Solaris
Hello gurus,
I have question. I have enabled ssh on the servers.
I am planning to change the oracle user's(os user) password. If I change the password will it affect the authorized_keys? Do I need to regenerate it.
Thanks, (2 Replies)
Discussion started by: oracleuser
2 Replies
6. UNIX for Dummies Questions & Answers
I have modified the .profile in my profile and I don't see any effect.
Why the changes don't have effect?
I tried both on the account at a server where I have limited permissions as user and to my local pc (as user).
Is it the .profile overridden by some other file? It looks weird because I... (8 Replies)
Discussion started by: myle
8 Replies
7. Shell Programming and Scripting
I have an array and two variables as below,
I need to check if $datevar is present in $filename.
If so, i need to replace $filename with the values in the array.
I need the output inside an ARRAY
How can this be done.
Any help will be appreciated. Thanks in advance. (2 Replies)
Discussion started by: irudayaraj
2 Replies
8. Homework & Coursework Questions
attempting the hangman program. This was an optional assignment from the professor. I have completed the logical coding, debugging now.
##I have an array $wordString that initializes to a string of dashes
##reflecting the number of letters in $theWord
##every time the user enters a (valid)... (5 Replies)
Discussion started by: lotsofideas
5 Replies
9. UNIX and Linux Applications
Good evening, i need your help please
I will try to describe the scenario briefly: In a Telecom Production system application receives a certain files called CDRs(call detail records) to be processed by doing some operating systems operations and then database operations like creating indexes... (4 Replies)
Discussion started by: alexcol
4 Replies
10. UNIX for Beginners Questions & Answers
I will start with an example of what I'm trying to do and then describe how I am approaching the issue.
File
PS028,005
Lexeme HRS # M #
PhraseType 1(1:1) 7(7)
PhraseLab 501 503
ClauseType ZYq0
PS028,005
Lexeme W # L> # BNH # M #... (17 Replies)
Discussion started by: jvoot
17 Replies