Sponsored Content
Top Forums Shell Programming and Scripting Store the output values in array Post 302666213 by KarthikPS on Wednesday 4th of July 2012 02:09:17 AM
Old 07-04-2012
Thanks for the reply,

The results i am getting from python script.

My shell script looks like this,

project=`fab $string $recuse details $host`
for i in ${project[@]}
do
echo $i
done

USAGE="$0 [initial] [name] [txt file] [value:0|1]

I am getting the values from python and i am storing in 'project'. The result have mentioned before in set followed by comma.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

how do I store the values in array using shell

Hi, Is is possible to get the value using shell script? x=1 y1 = 10 y2 = 15 y3 = 7 echo $y$x is giving y1 (variable name) but I need the value of y1 (i.e. 10 dynamically) Is there any solution? if so, please mail me at kkodava@maxis.com.my ... (2 Replies)
Discussion started by: krishna
2 Replies

2. UNIX for Dummies Questions & Answers

How to store the values in a file into an array

Hi, I do have a file and the contents are as follws: 10 20 30 40 50 Now I want to store those values into an array. How can be done this ?? (3 Replies)
Discussion started by: risshanth
3 Replies

3. UNIX for Dummies Questions & Answers

trouble using read to store values in variables from command output

I know there are caveats about using read in pipelines because read is treated by a subshell. I know this but I can't think of any way to accomplish this regardless, I'm still a rookie. I hope somebody will be able to interpret what it is that I'm trying to accomplish and correct me. ... (2 Replies)
Discussion started by: ProGrammar
2 Replies

4. Shell Programming and Scripting

Store values in an Array

Hi all. Well, I have the next code: I need to make an array with the values I have in the bucle, but just don't get it... Question is, how can I store in an array that values, and how can I display them with echo? (8 Replies)
Discussion started by: crcbad
8 Replies

5. Shell Programming and Scripting

Store all the passed arguments in an array and display the array

Hi I want to write a script which store all the parameters passed to the script into an array. Once it is stored I want scan through the array and and delete those files for last month present inside the directory. The files in directory is appneded with YYYY_MM_DD. I want to know how can I... (3 Replies)
Discussion started by: dgmm
3 Replies

6. Shell Programming and Scripting

How to store output of command to an array

Hello Guys, I am trying to store output of command to an array and then want to print, but it showing an error that "bad substitution". I am not getting why it's happening. Can anyone help me? #!/usr/bin/sh hr=0 min=0 i=1 last $1 | grep -w `date "+%b"` | grep -v '\(0:.*\)' | grep -vw sshd... (8 Replies)
Discussion started by: kasparov
8 Replies

7. Shell Programming and Scripting

Store values from a file into an array variable in Shell

Dear All, I have been trying to do a simple task of extracting 2 fields from the file (3 rows) and store it in an array variable. I tried with: #! /bin/bash ch=`cut -f10 tmp.txt` counter=0 for p in $pid do c=${ch} echo "$c ..$counter" counter=$((counter+1))... (2 Replies)
Discussion started by: ezhil01
2 Replies

8. Shell Programming and Scripting

How to read values and store in array?

I am reading a value from a file and want to store the value in a dynamic array as i don't know the number of occurrences of the value in that file. How can i do that and then later fetch that value from array (25 Replies)
Discussion started by: Prachi Gupta
25 Replies

9. Shell Programming and Scripting

ksh : need to store the output of a awk command to a array

I have awk command : awk -F ' ' '{ print $NF }' log filename And it gives the output as below: 06:00:00 parameters: SDS (2) no no no no doc=4000000000). information: (6 Replies)
Discussion started by: ramprabhum
6 Replies

10. Shell Programming and Scripting

awk loop using array:wish to store array values from loop for use outside loop

Here's my code: awk -F '' 'NR==FNR { if (/time/ && $5>10) A=$2" "$3":"$4":"($5-01) else if (/time/ && $5<01) A=$2" "$3":"$4-01":"(59-$5) else if (/time/ && $5<=10) A=$2" "$3":"$4":0"($5-01) else if (/close/) { B=0 n1=n2; ... (2 Replies)
Discussion started by: klane
2 Replies
IPCHECK(8)						  System Administration Utilities						IPCHECK(8)

NAME
ipcheck - dyndns.org client DESCRIPTION
Usage : ipcheck.py [options] Username Password Hostnames or ipcheck.py [options] --acctfile acct_info_file Options: -a address manually specify the address -r URL NAT router, use web IP detection -A text scan syslog for an IP after text (Unix only) -F filename guess the WAN IP from a firewall log -b backup mx option ON (default OFF) -c custom dns option (default dynamic) -d dir directory for data files (default current) -e script execute script after a successful update -f force update regardless of current state -g NAT router, let dyndns guess your IP (do not use this in a cronjob, try -r) -h print this help text --help print all available help text -i interface interface for local address (default ppp0) -j disable https -l log debugging text to ipcheck.log file --syslog log debugging text to syslog (Unix only) -m mxhost mx host (default NOCHG) -o set dyndns offline mode -p proxy bypass on port 8245 -q quiet mode (unless there is an error) -s static dns option (default dynamic) -t test run, do not send the update -v verbose mode -w wildcard mode ON (default OFF) --makedat create the ipcheck.dat file by dns lookup --devices print router options (Linksys, Netgear, etc) -n ip the router IP address on the internal lan For help with different options: python ipcheck.py -h For supported devices listing : python ipcheck.py --devices For long detailed help text : python ipcheck.py --help Make sure you can write to the current directory for data files and that you always run from the same directory. The first time you run the script, you will be asked to run with the --makedat option in addition to any other options. This will create the data files for the hostnames and options your specify on the command line. You should only do this once. Subsequent runs should be made without the --make- dat option. For help with different options: python ipcheck.py -h For supported devices listing : python ipcheck.py --devices For long detailed help text : python ipcheck.py --help Example 1: the external IP is on eth0 of the current machine python ipcheck.py -l -i eth0 username password hostnames Example 2: you are using the Linksys routing device python ipcheck.py -l -L linksyspassword username password hostnames Example 3: you want to use web based ip detection python ipcheck.py -l -r checkip.dyndns.org:8245 ... where ... is your dyndns username password and hostnames. Hostnames should be comma delimited if there are more than one. Debian GNU/Linux January 2012 IPCHECK(8)
All times are GMT -4. The time now is 02:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy