Sponsored Content
Top Forums Shell Programming and Scripting retreiving and assigning values and manipulating string in a for loop Post 302325451 by Franklin52 on Monday 15th of June 2009 08:10:11 AM
Old 06-15-2009
Try something like this:

Code:
n=0
psg proc_s | awk '/tY/{split($5,a,":");print a[2]}'| while read s
do
  Sam[$n]="$s"
  n=$(( $n + 1))
  # other code
  # ....
done
echo $Sam[1]

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Assigning values to an array

The way I've been using arrays currently have been: #!/bin/ksh set -A myArray myArray=value1 myArray=value2 myArray=value3 myArray=value4 Is there a way I can assign values to an array that will automatically place the value into the next element in the array like: myArray=value1... (4 Replies)
Discussion started by: yongho
4 Replies

2. UNIX for Dummies Questions & Answers

assigning values to a variable

i try to get the year and month values using the below shell script when i enter the script like this #!/usr/bin/ksh dd=`DATE +%Y%M` echo $dd it is showing the error as shown below abc.ksh: DATE: not found any suggestions please (3 Replies)
Discussion started by: trichyselva
3 Replies

3. UNIX for Dummies Questions & Answers

string manipulating

I have a file like this: Tue Apr 15 10:41:47 MDT 2008 FINAL RESULT; 6 Tue Apr 15 10:41:47 MDT 2008 FINAL RESULT; 2 Tue Apr 15 10:41:47 MDT 2008 FINAL RESULT; 5 With this command seira=`cut -f 2 -d ';' tes.txt` i take all the results (6,2,5 etc) and i store them in variable seira When i do... (9 Replies)
Discussion started by: psalas
9 Replies

4. Shell Programming and Scripting

Assigning the values to an Array

hi every body, i donot know how to assign a array varible with a file see i having file more file property1 Name property2 Address the above two line are tab Space seperated between the property and its value i want to seperate it and assign to... (1 Reply)
Discussion started by: kkraja
1 Replies

5. Shell Programming and Scripting

Assigning values to an array via for/while loop

I need to do something like this: for i in 1 2 3 4 5; do arr=$(awk 'NR="$i" { print $2 }' file_with_5_records) done That is, parse a file and assign values to an array in an ascending order relative to the number of record in the file that is being processed on each loop. Is my... (2 Replies)
Discussion started by: fiori_musicali
2 Replies

6. Shell Programming and Scripting

Need help in manipulating string variable

I have written a shell script to do some processing and have to manipulate a variable. Basically, the variable is like this -- var=set policy:set cli My purpose is to split it into two variables based on the position of ":". To get the right end, I am doing this -- vaa1=${vaa#*:} ... (1 Reply)
Discussion started by: Dev_Sharma987
1 Replies

7. Shell Programming and Scripting

Help in assigning values to variables from the file

Hi! This might be a simple thing, but I'm struggling to assign values to variables from the file. I've the following values stored in the file.. It consists of only two rows.. 10 20 I want to assign the first row value to variable "n1" and the second row value to variable "n2".. That is ... (3 Replies)
Discussion started by: abk07
3 Replies

8. UNIX Desktop Questions & Answers

Manipulating a list of numbers based on values

Hi, I have a single column of numbers from in tabulated text format ranging from 0 to 1. I want to manipulate the list of numbers so that if the number is greater than 0.5 (> 0.5), I get 1 - number. If the number is less than 0.5, the number is taken as it is and not altered. For example: ... (1 Reply)
Discussion started by: evelibertine
1 Replies

9. Shell Programming and Scripting

[Solved] Assigning a value to a variable name then running a loop on these values

Hi, I was wondering if anyone could assist me for (what is probably) a very straightforward answer. I have input files containing something like File 1 Apples Apples Apples Apples File 2 Bananas Bananas Bananas Bananas (4 Replies)
Discussion started by: hubleo
4 Replies

10. Shell Programming and Scripting

Assigning values to 2 variables within for loop

Hi All, Is it possible to grep for two files and assign their names to two separate variables with for loop? I am doing the below currently: if then for fname in $( cd $dirA ; ls -tr | grep "^Ucountry_file$") do InFile=$dirA/$fname ... (4 Replies)
Discussion started by: swasid
4 Replies
DateTime::Locale::de_BE(3)				User Contributed Perl Documentation				DateTime::Locale::de_BE(3)

NAME
DateTime::Locale::de_BE SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'de_BE' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for German Belgium. DATA
This locale inherits from the DateTime::Locale::de locale. It contains the following data. Days Wide (format) Montag Dienstag Mittwoch Donnerstag Freitag Samstag Sonntag Abbreviated (format) Mon Die Mit Don Fre Sam Son Narrow (format) Mon Die Mit Don Fre Sam Son Wide (stand-alone) Montag Dienstag Mittwoch Donnerstag Freitag Samstag Sonntag Abbreviated (stand-alone) Mon Die Mit Don Fre Sam Son Narrow (stand-alone) M D M D F S S Months Wide (format) Januar Februar Maerz April Mai Juni Juli August September Oktober November Dezember Abbreviated (format) Jan Feb Maer Apr Mai Jun Jul Aug Sep Okt Nov Dez Narrow (format) J F M A M J J A S O N D Wide (stand-alone) Januar Februar Maerz April Mai Juni Juli August September Oktober November Dezember Abbreviated (stand-alone) Jan Feb Maer Apr Mai Jun Jul Aug Sep Okt Nov Dez Narrow (stand-alone) J F M A M J J A S O N D Quarters Wide (format) 1. Quartal 2. Quartal 3. Quartal 4. Quartal Abbreviated (format) Q1 Q2 Q3 Q4 Narrow (format) 1 2 3 4 Wide (stand-alone) 1. Quartal 2. Quartal 3. Quartal 4. Quartal Abbreviated (stand-alone) Q1 Q2 Q3 Q4 Narrow (stand-alone) 1 2 3 4 Eras Wide v. Chr. n. Chr. Abbreviated v. Chr. n. Chr. Narrow v. Chr. n. Chr. Date Formats Full 2008-02-05T18:30:30 = Dienstag 5 Februar 2008 1995-12-22T09:05:02 = Freitag 22 Dezember 1995 -0010-09-15T04:44:23 = Samstag 15 September -10 Long 2008-02-05T18:30:30 = 5 Februar 2008 1995-12-22T09:05:02 = 22 Dezember 1995 -0010-09-15T04:44:23 = 15 September -10 Medium 2008-02-05T18:30:30 = 05.02.2008 1995-12-22T09:05:02 = 22.12.1995 -0010-09-15T04:44:23 = 15.09.-010 Short 2008-02-05T18:30:30 = 5/02/08 1995-12-22T09:05:02 = 22/12/95 -0010-09-15T04:44:23 = 15/09/-10 Default 2008-02-05T18:30:30 = 05.02.2008 1995-12-22T09:05:02 = 22.12.1995 -0010-09-15T04:44:23 = 15.09.-010 Time Formats Full 2008-02-05T18:30:30 = 18 h 30 min 30 s UTC 1995-12-22T09:05:02 = 09 h 05 min 02 s UTC -0010-09-15T04:44:23 = 04 h 44 min 23 s UTC Long 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Medium 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Short 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 Default 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Datetime Formats Full 2008-02-05T18:30:30 = Dienstag 5 Februar 2008 18 h 30 min 30 s UTC 1995-12-22T09:05:02 = Freitag 22 Dezember 1995 09 h 05 min 02 s UTC -0010-09-15T04:44:23 = Samstag 15 September -10 04 h 44 min 23 s UTC Long 2008-02-05T18:30:30 = 5 Februar 2008 18:30:30 UTC 1995-12-22T09:05:02 = 22 Dezember 1995 09:05:02 UTC -0010-09-15T04:44:23 = 15 September -10 04:44:23 UTC Medium 2008-02-05T18:30:30 = 05.02.2008 18:30:30 1995-12-22T09:05:02 = 22.12.1995 09:05:02 -0010-09-15T04:44:23 = 15.09.-010 04:44:23 Short 2008-02-05T18:30:30 = 5/02/08 18:30 1995-12-22T09:05:02 = 22/12/95 09:05 -0010-09-15T04:44:23 = 15/09/-10 04:44 Default 2008-02-05T18:30:30 = 05.02.2008 18:30:30 1995-12-22T09:05:02 = 22.12.1995 09:05:02 -0010-09-15T04:44:23 = 15.09.-010 04:44:23 Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 Ed (E d.) 2008-02-05T18:30:30 = Die 5. 1995-12-22T09:05:02 = Fre 22. -0010-09-15T04:44:23 = Sam 15. EEEd (d. EEE) 2008-02-05T18:30:30 = 5. Die 1995-12-22T09:05:02 = 22. Fre -0010-09-15T04:44:23 = 15. Sam H (H) 2008-02-05T18:30:30 = 18 1995-12-22T09:05:02 = 9 -0010-09-15T04:44:23 = 4 HHmm (HH:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 HHmmss (HH:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Hm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 nachm. 1995-12-22T09:05:02 = 9:05 vorm. -0010-09-15T04:44:23 = 4:44 vorm. Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 nachm. 1995-12-22T09:05:02 = 9:05:02 vorm. -0010-09-15T04:44:23 = 4:44:23 vorm. M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (d.M.) 2008-02-05T18:30:30 = 5.2. 1995-12-22T09:05:02 = 22.12. -0010-09-15T04:44:23 = 15.9. MEd (E, d.M.) 2008-02-05T18:30:30 = Die, 5.2. 1995-12-22T09:05:02 = Fre, 22.12. -0010-09-15T04:44:23 = Sam, 15.9. MMd (d.MM.) 2008-02-05T18:30:30 = 5.02. 1995-12-22T09:05:02 = 22.12. -0010-09-15T04:44:23 = 15.09. MMdd (dd.MM.) 2008-02-05T18:30:30 = 05.02. 1995-12-22T09:05:02 = 22.12. -0010-09-15T04:44:23 = 15.09. MMM (LLL) 2008-02-05T18:30:30 = Feb 1995-12-22T09:05:02 = Dez -0010-09-15T04:44:23 = Sep MMMd (d. MMM) 2008-02-05T18:30:30 = 5. Feb 1995-12-22T09:05:02 = 22. Dez -0010-09-15T04:44:23 = 15. Sep MMMEd (E d. MMM) 2008-02-05T18:30:30 = Die 5. Feb 1995-12-22T09:05:02 = Fre 22. Dez -0010-09-15T04:44:23 = Sam 15. Sep MMMMd (d MMMM) 2008-02-05T18:30:30 = 5 Februar 1995-12-22T09:05:02 = 22 Dezember -0010-09-15T04:44:23 = 15 September MMMMdd (dd. MMMM) 2008-02-05T18:30:30 = 05. Februar 1995-12-22T09:05:02 = 22. Dezember -0010-09-15T04:44:23 = 15. September MMMMEd (E d. MMMM) 2008-02-05T18:30:30 = Die 5. Februar 1995-12-22T09:05:02 = Fre 22. Dezember -0010-09-15T04:44:23 = Sam 15. September mmss (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 ms (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (yyyy-M) 2008-02-05T18:30:30 = 2008-2 1995-12-22T09:05:02 = 1995-12 -0010-09-15T04:44:23 = -010-9 yMEd (EEE, yyyy-M-d) 2008-02-05T18:30:30 = Die, 2008-2-5 1995-12-22T09:05:02 = Fre, 1995-12-22 -0010-09-15T04:44:23 = Sam, -010-9-15 yMMM (MMM y) 2008-02-05T18:30:30 = Feb 2008 1995-12-22T09:05:02 = Dez 1995 -0010-09-15T04:44:23 = Sep -10 yMMMEd (EEE, d. MMM y) 2008-02-05T18:30:30 = Die, 5. Feb 2008 1995-12-22T09:05:02 = Fre, 22. Dez 1995 -0010-09-15T04:44:23 = Sam, 15. Sep -10 yMMMM (MMMM y) 2008-02-05T18:30:30 = Februar 2008 1995-12-22T09:05:02 = Dezember 1995 -0010-09-15T04:44:23 = September -10 yQ (Q yyyy) 2008-02-05T18:30:30 = 1 2008 1995-12-22T09:05:02 = 4 1995 -0010-09-15T04:44:23 = 3 -010 yQQQ (QQQ y) 2008-02-05T18:30:30 = Q1 2008 1995-12-22T09:05:02 = Q4 1995 -0010-09-15T04:44:23 = Q3 -10 yyMM (MM/yy) 2008-02-05T18:30:30 = 02/08 1995-12-22T09:05:02 = 12/95 -0010-09-15T04:44:23 = 09/-10 yyMMdd (dd.MM.yy) 2008-02-05T18:30:30 = 05.02.08 1995-12-22T09:05:02 = 22.12.95 -0010-09-15T04:44:23 = 15.09.-10 yyMMM (MMM yy) 2008-02-05T18:30:30 = Feb 08 1995-12-22T09:05:02 = Dez 95 -0010-09-15T04:44:23 = Sep -10 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 yyQQQQ (QQQQ yy) 2008-02-05T18:30:30 = 1. Quartal 08 1995-12-22T09:05:02 = 4. Quartal 95 -0010-09-15T04:44:23 = 3. Quartal -10 yyyy (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yyyyMMMM (MMMM y) 2008-02-05T18:30:30 = Februar 2008 1995-12-22T09:05:02 = Dezember 1995 -0010-09-15T04:44:23 = September -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week Montag SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.16.3 2014-06-10 DateTime::Locale::de_BE(3)
All times are GMT -4. The time now is 02:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy