7 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
RedHat 5
KSH
I am creating an array, and then using case to go through and count for specific words. Then the count gets stored as an expression.
string='ftp rcp rsh telnet ftp ftp'
set -A myarray $string
FTPCOUNT="0"
for command in ${myarray}
do
case $command in
ftp) FTPCOUNT=`expr... (2 Replies)
Discussion started by: nitrobass24
2 Replies
2. UNIX and Linux Applications
Hi Guys,
My code is something like this
set -A A1 1 7 13 19
set -A A2 2 8 14 20
set -A A3 3 9 15 21
echo "Enter a number"
read number
for i in 0 2 3 4
do
if }" ]
then
do something
elif }" ]
then
do something
elif }" ]
then
do something (4 Replies)
Discussion started by: jeanzibbin
4 Replies
3. Shell Programming and Scripting
Hi All,
My Requirement is as follows:
1. User will input Source Sytem Code as input.
2. I have source system codes as 11, 34, 56, 99, 45 etc.
OS Version: SunOS 5.8 Generic_117350-62 sun4u sparc SUNW,Sun-Fire-V890
My code is like...
echo 'Source System Code: \c'
read varSSCode... (3 Replies)
Discussion started by: saps19
3 Replies
4. UNIX for Dummies Questions & Answers
The following command is only intermittently successful, depends on the data I give it:
set -A ImageShifts_sorted `awk '/START_SECTION IMAGE_DEFINITION/ {getline;getline;getline;getline; print $2"-"$3}' temp.ASCII | sort -u`
My Error:
set: -1: unknown option
Finally, If I run that... (3 Replies)
Discussion started by: nerdcurious
3 Replies
5. UNIX for Advanced & Expert Users
Hi all,
Following code in ksh is giving error:
fileLimit=5
func(){
dir="$1"
format="$2"
array="$3"
i=0
ls -lrt $format | tail -${fileLimit} | while read f_det; do
files="${f_det},"
((i+=1))
done
eval $(echo set -A $array '"${files}"')
}
func "." "*.pl" "a"
echo... (10 Replies)
Discussion started by: PRKS
10 Replies
6. Shell Programming and Scripting
Hi Everyone,
This is just my method to if want fields in a file into each array.
# cat /tmp/3.txt
00:00:01 1
00:00:02 2
00:00:03 33
# cat text.pl
#!/usr/bin/perl
@field1 = `cat '/tmp/3.txt' | cut -f1 -d'\t'`;
print $field1;
# ./text.pl
00:00:01
#
As we can... (4 Replies)
Discussion started by: jimmy_y
4 Replies
7. Shell Programming and Scripting
hi all,
need help with putting names in an array, i have a few servers which i look up by doing a 'find . -name "*.pid' and the format of the output is like following :
./servername/myserver.pid
i was wondering how can i iterate through and store each name in one array
my code is... (1 Reply)
Discussion started by: cesarNZ
1 Replies