Don: My apologies for the initial lack of info. I am also using MacOS Sierra.
I also tried running that script on my work shell.
Quote:
which just switches the inner and outer loops in the code I suggested before, changes the names of the arrays used as looping values, and adds code to add an empty line between groups. The above produces the output requested in post #4.
Thanks for the edit. I unfortunately do not have the option to rewrite the script my contrived example is based on from scratch. But I'll surely give ksh a try on another project! It seems to be more flexible than bash.
---------- Post updated at 05:45 PM ---------- Previous update was at 05:35 PM ----------
RudiC: Here is the code with typeset -n that I wasn't lucky with:
It looks like neither shell at home or work has typeset -n
Hey All,
I'm trying to clean up a variable using sed but It dosn't seem to work. I'm trying to find all the spaces and replace them with "\ " (a slash and a space). For Example "Hello World" should become "Hello\ World". But it does nothing. If I put it directly into the command line it works... (3 Replies)
Hi everyone,
I have a simple question to ask :
In a script that I'm writting, I need to create variables on-the-fly.
For instance, for every iterartion of the following loop a var_X variable should be generated :
#!/bin/ksh
a="1 2 3"
for i in $a
do
var_${i}=$i
echo "${var_$i}"
done
... (1 Reply)
I have run into a wall with my iptables firewall scripting.
I am blocking all of the private side IP addresses on the
WAN interface on systems running NAT. However, if the
system is not running NAT and needs to allow access to
the local LAN on the WAN interface, I need to block all
but one of... (2 Replies)
Hello,
i have another sed question.. I'm trying to do variable substition with sed and i'm running into a problem.
my var1 is a string constructed like this:
filename1 filerev1 filepath1
my var2 is another string constructed like this:
filename2 filerev2 filepath2
when i do... (2 Replies)
Hi,
That might be pretty simple.
How can I generate a variable name and get their value ?
Thanks a lot.
Something like:
>CUSTOMER_NF=26
> object=CUSTOMER
> echo ${object}_NF
CUSTOMER_NF
> echo ${${object}_NF}
ksh: ${${object}_NF}: 0403-011 The specified substitution is... (7 Replies)
file1.ksh
#!/bin/ksh
test5_create="I am a man" # test5 will be dynamic and the value will be passed from command line
a=${1}_create
echo $a # i need the output as "I am a man"
./file1.ksh test5 # i run the script like this
any suggessions guys... (1 Reply)
Hi all.
I'm trying to finish a bash script with the following elements:
ARRAY="blah $ITEM blah blah"
ARRAY="blah blah $ITEM blah bluh"
#ARRAY="...."
# ...the ARRAY elements represent a variable but defined
# syntax and they're all hard-coded in the script.
#(...)
ITEMS='1.0 2.3... (2 Replies)
Hi ,
I have a variable as follows,
Temp=`cat ABC.txt | cut -c5-`
This will yeild a part of the date. say , 200912.
I would like to substitute this variable's value in a filename.
eg: File200912F.zip
when i say File$TempF.zip , it is not substituting.
Any help ?
Thanks in... (2 Replies)
For example I have variable like below
echo $OUTPUT
/some/path/`uname -n`
when I try to use the variable OUTPUT like below
cd $OUTPUT or cd ${OUTPUT}
I am getting bad substituion error message
$ cd $OUTPUT
ksh: cd: bad substitution
$ cd ${OUTPUT}
ksh: cd: bad substitution
... (1 Reply)
Hi,
I have to write a shell script in which I have to substitute a variable within a variable. For example,
var1=aaa
var2=file.$var1.txt
The output should be,
echo $var2
file.aaa.txt
Can someone please help me in getting this. I tried using eval, but it didnt work. I might be using it... (2 Replies)
Discussion started by: grajp002
2 Replies
LEARN ABOUT SUSE
finance::quote::financecanada
Finance::Quote::FinanceCanada(3) User Contributed Perl Documentation Finance::Quote::FinanceCanada(3)NAME
Finance::Quote::FinanceCanada - Obtain stock and mutual fund prices from finance.canada.com
SYNOPSIS
use Finance::Quote;
$q = Finance::Quote->new;
# Can failover to other methods
%quotes = $q->fetch("canada", "stock_fund-code");
# Use this module only
%quotes = $q->fetch("financecanada", "stock_fund-code");
DESCRIPTION
This module obtains information about Canadian Stock and Mutual Funds from finanace.canada.com. The information source "canada" can be
used if the information source is unimportant, or "financecanada" to specifically use finance.canada.com.
STOCK_FUND-CODE
Canadian stocks/mutual funds do not have a unique symbol identifier. This module uses the symbols as used on finance.canada.com. The
simplest way to fetch the ID for a particular stock/fund is to go to finance.canada.com, search for your particular stock or mutual fund,
and note the symbol ID. This is helpfully provided by the site in their returned HTML quote.
LABELS RETURNED
Information available from financecanada may include the following labels:
method source name symbol currency date nav last price
SEE ALSO
Finance Canada.com website - http://finance.canada.com/
Finance::Quote
perl v5.12.1 2009-10-05 Finance::Quote::FinanceCanada(3)