Sponsored Content
Top Forums Shell Programming and Scripting affect a exploded a string into an array Post 302113377 by ennstate on Thursday 5th of April 2007 02:17:43 PM
Old 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

string to array

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

changig uid and the affect it will have

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

making new default gateway take affect

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

affect variable

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

Will Password change affect authorized_keys?

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

.profile - changes don't affect the login

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

PERL : Read an array and write to another array with intial string pattern checks

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

passing letters from an array into a string for string comparison

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

Having too many connections could affect performance ?

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

awk Associative Array and/or Referring to Field by String (Nonconstant String Value)

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
Test::HTML::W3C(3pm)					User Contributed Perl Documentation				      Test::HTML::W3C(3pm)

NAME
Test::HTML::W3C - Perform W3C HTML validation testing SYNOPSIS
use Test::HTML::W3C tests => $test_count; # or use Test::HTML::W3C 'show_detail'; # or when using both use Test::HTML::W3C tests => $test_count, 'show_detail'; is_valid_markup($my_html_scalar); is_valid_file("/path/to/my/file.html"); is_valid("http://example.com"); # Get the underlying WebService:;Validator::W3C::HTML object my $validator = validator(); DESCRIPTION
The purpose of this module is to provide a wrapper around the W3C that works with the Test::More testing framework. ABUSE
Please keep in mind that the W3C validation pages and services are a shared resource. If you plan to do many many tests, please consider using your own installation of the validation programs, and then use your local install by modifying the local validtor: my $v = validator(); $v->validator_uri($my_own_validator); See the documentation for WebService:;Validator::W3C::HTML and the W3C's site at http://validator.w3.org/ for details validator(); Description: Returns the underlying WebService::Validator::HTML::W3C object Parameters: None. Returns: $validator plan(); Description: Access to the underlying "plan" method provided by Test::Builder. Parameters: As per Test::Builder is_valid_markup($markup[, $name]); Description: is_valid_markup tests whether the text in the provided scalar value correctly validates according to the W3C specifications. This is useful if you have markup stored in a scalar that you wish to test that you might get from using LWP or WWW::Mechanize for example... Parameters: $markup, a scalar containing the data to test, $name, an optional descriptive test name. Returns: None. is_valid_file($path[, $name]); Description: is_valid_file works the same way as is_valid_markup, except that you can specify the text to validate with the path to a filename. This is useful if you have pregenerated all your HTML files locally, and now wish to test them. Parameters: $path, a scalar, $name, an optional descriptive test name. Returns: None. is_valid($url[, $name]); Description: is_valid, again, works very similarly to the is_valid_file and is_valid_file, except you specify a document that is already online with its URL. This can be useful if you wish to periodically test a website or webpage that dynamically changes over time for example, like a blog or a wiki, without first saving the html to a file using your browswer, or a utility such as wget. Parameters: $url, a scalar, $name, an optional descriptive test name. Returns: None. diag_html($url); Description: If you want to display the actual errors reported by the service for a particular test, you can use the diag_html function. Please note that you must have imported 'show_detail' for this to work properly. use Test::HTML::W3C 'show_detail'; is_valid_markup("<html></html">, "My simple test") or diag_html(); Parameters: $url, a scalar. Returns: None. SEE ALSO
Test::Builder::Module for creating your own testing modules. Test::More for another popular testing framework, also based on Test::Builder Test::Harness for detils about how test results are interpreted. AUTHORS
Victor <victor73@gmail.com> with inspiration from the authors of the Test::More and WebService::Validator::W3C:HTML modules. BUGS
See http://rt.cpan.org to report and view bugs. COPYRIGHT
Copyright 2006 by Victor <victor73@gmail.com>. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html perl v5.12.4 2011-08-22 Test::HTML::W3C(3pm)
All times are GMT -4. The time now is 07:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy