10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello all,
I have following piece of code which is working fine if executed standalone -
date=$1
set -A max_month 0 31 28 31 30 31 30 31 31 30 31 30 31
eval $(echo $date|sed 's!\(....\)\(..\)\(..\)!year=\1;month=\2;day=\3!')
(( year4=year%4 ))
(( year100=year%100 ))
(( year400=year%400 ))... (7 Replies)
Discussion started by: ektubbe
7 Replies
2. UNIX for Dummies Questions & Answers
Is there a way to print multiple array elements without iterating through the array using bash?
Can you do something like...
echo ${array}and get all those separate elements from the array? (2 Replies)
Discussion started by: jrymer
2 Replies
3. Shell Programming and Scripting
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)
Discussion started by: rajukv
1 Replies
4. Shell Programming and Scripting
Hi.
I´ve a script that should substitude the 8th line in a file called xxx.num6.
The "xxx" is set by an array filled with this command:
j=0
for Par in *.sys ; do
Par=`echo $Par | sed 's/\(.*\).sys/\1/'` ;
Par2="$Par" ; echo "${Par2}"
j=$((j + 1));
done
Now i try... (0 Replies)
Discussion started by: Lock3
0 Replies
5. Shell Programming and Scripting
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)
Discussion started by: mohanpadamata
2 Replies
6. Shell Programming and Scripting
I've created a series of arrays named as follows:
row1
row2
row3
.
.
.
row10
Each has 4 elements.
I'm trying to echo the array elements out in a for loop. Here's what I have:
for ((i=1;i<=10;i++))
do
for ((j=1;j<=4;j++))
do
eval out=${row`echo $i`}
echo -n $out (3 Replies)
Discussion started by: swankgd
3 Replies
7. Shell Programming and Scripting
Hello,
Please tell me if there is a better way to get the number of elements from an array that is passed to a function.
This is what works on Solaris 8 (ksh) but it looks odd:
loop_array() {
array_name=$2
b1='\${\#'
b2='}'
nr_elements=`eval echo... (6 Replies)
Discussion started by: majormark
6 Replies
8. Shell Programming and Scripting
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)
Discussion started by: alrinno
2 Replies
9. Shell Programming and Scripting
Dear friends ,
The output file of below script
Pls#!/bin/sh
awk '{
bo = substr($0,13,3)
slm = substr($0,150,8)
slo = substr($0,175,7)
inc = substr($0,97,10)/100
busi = substr($0,83,10)
mth = substr($0,39,2)
yer = substr($0,35,4)
... (2 Replies)
Discussion started by: vakharia Mahesh
2 Replies
10. Shell Programming and Scripting
I am using an array (clmlist01). I have 61 of these and have 4 or more references to each one in a block of code that I do not want to have to hardcode. With that being said, I am creating a varible and going through a for loop to create the actually name of each array. The arrays would end up... (3 Replies)
Discussion started by: dsimpg1
3 Replies