Sponsored Content
Top Forums Shell Programming and Scripting My script work on Linux but not work in sunos. Post 302763485 by ooilinlove on Wednesday 30th of January 2013 05:13:30 AM
Old 01-30-2013
My script work on Linux but not work in sunos.

My script work on Linux but not work in sun os.

my script.

Code:
logFiles="sentLog1.log sentLog2.log"
intial_time="0 0"
logLocation="/usr/local/tomcat/logs/"
sleepTime=600


failMessage=":: $(tput bold)Log not update$(tput rmso) = "
successMessage="OK"

arr=($logFiles)
time_arr=($intial_time)
arrlen=${#arr[@]}
arrcount=()



date
for count=0; count<arrlen; count++ ; do
    arrcount[$count]=`ls -l  $logLocation${arr[$count]}  |awk '{print $5}'`
    echo "${arr[$count]} Original size :: ${arrcount[$count]}"
done
echo

while [ "e" == "e" ] ; do 
    sleep $sleepTime
    date

    for ((count=0; count<arrlen; count++)) ; do
        nc=`ls -l  $logLocation${arr[$count]}  |awk '{print $5}'`
        echo -n "${arr[$count]} "
        if [ $nc == ${arrcount[$count]} ] ; then
         time_arr[$count]=`echo ${time_arr[$count]} + 10 | bc`       
            echo $failMessage " " ${time_arr[$count]} " Minute."
        else
            arrcount[$count]=$nc
            echo $successMessage
   time_arr[$count]=0
        fi
    done
    echo
 echo
 echo
 echo
done

run on linux it ok. but run on sun os it not ok.


output of sun os.
Code:
Wed Jan 30 17:08:28 USA 2013
./MonSellVASMDB.sh: line 18: syntax error near unexpected token `(('
./MonSellVASMDB.sh: line 18: `for ((count=0; count<arrlen; count++)) ; do'

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ISDN on Linux..will it work?

Hi everyone! I going to change from a 56k modem to a ISDN connection and was wondering if this will work under Linux and what i would need to get it up and running ? (on Mandrake 8.0).. thanx in advance.. grtz phaelanx :) (4 Replies)
Discussion started by: Phaelanx
4 Replies

2. UNIX for Dummies Questions & Answers

Is it possible to put the whole Linux OS on DVD and work with it?

Is it possible to put the whole Linux OS on DVD and work with it? If yes, how to do it? (1 Reply)
Discussion started by: alexhon
1 Replies

3. UNIX for Dummies Questions & Answers

Work on Linux Using Bootable CD ??

Hi , I am using a laptop with windows XP as the operating system. i want to use linux/unix without installing it on my machine. I heard that i can do so using some Linux bootable CD .... which can be used to work on linux environment with out physically installing it on your system. I... (2 Replies)
Discussion started by: newbie07
2 Replies

4. UNIX for Dummies Questions & Answers

Script doesn't work, but commands inside work

Howdie everyone... I have a shell script RemoveFiles.sh Inside this file, it only has two commands as below: rm -f ../../reportToday/temp/* rm -f ../../report/* My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Discussion started by: cheongww
2 Replies

5. UNIX for Dummies Questions & Answers

Any Linux/Unix work with SATA yet?

i got my computer in 2k, built it myself. top of the line then and better than most still now. one problem however is i was never able to install unix because the old kernels were not compatible with SATA hard drives i dont have any IDE drives nor do i want any I want mine on SATA, but every... (5 Replies)
Discussion started by: GXDeMoNN
5 Replies

6. Linux

Will solaris commands work on linux machine

Earlier we are using solaris machine to run our script which is having korn shell. Due to decommision of that machine we have to switch to Linux machine which is also having korn shell. Do the commands on solaris machine will also work on linux machine or should i have to change any thing? One... (4 Replies)
Discussion started by: sanapart
4 Replies

7. Shell Programming and Scripting

Help gettgin this script to work on linux

This script used to work on windows but is erroring our at line 25 when run under linux. The specific errir that i get is "Can't call method "mtime" on an undefined value at ./make_event_log_index.pl line 25." Any help would be appreciated ... (4 Replies)
Discussion started by: binary-ninja
4 Replies

8. What is on Your Mind?

[?] Does Netflix work on Linux in Firefox?

I've tried to totally ignore Netfix to date, though I might change my mind. But I refuse to keep a Windows box running for any reason. Is anyone streaming movies from Netflix and watching them on a Linux box? I went to netflix.com to look for the requirements page. None. OK, how about a... (4 Replies)
Discussion started by: KenJackson
4 Replies

9. IP Networking

Discussion at work, would a router work pluging a cable in wan1 and lan1?

hi all. and sorry for the random question, but this sparkled a raging flame-war at work and i want more points of view situation a router, with linux of some sort, dhcp client requesting for ip in wan1 (as usual with wan ports) dhcp server listening in lan1, and assigning ip (as usual... (9 Replies)
Discussion started by: broli
9 Replies
clear(1)						      General Commands Manual							  clear(1)

NAME
clear - clear the terminal screen SYNOPSIS
clear [-Ttype] [-V] [-x] DESCRIPTION
clear clears your screen if this is possible, including its scrollback buffer (if the extended "E3" capability is defined). clear looks in the environment for the terminal type given by the environment variable TERM, and then in the terminfo database to determine how to clear the screen. clear writes to the standard output. You can redirect the standard output to a file (which prevents clear from actually clearing the screen), and later cat the file to the screen, clearing it at that point. OPTIONS
-T type indicates the type of terminal. Normally this option is unnecessary, because the default is taken from the environment variable TERM. If -T is specified, then the shell variables LINES and COLUMNS will also be ignored. -V reports the version of ncurses which was used in this program, and exits. The options are as follows: -x do not attempt to clear the terminal's scrollback buffer using the extended "E3" capability. HISTORY
A clear command appeared in 2.79BSD dated February 24, 1979. Later that was provided in Unix 8th edition (1985). AT&T adapted a different BSD program (tset) to make a new command (tput), and used this to replace the clear command with a shell script which calls tput clear, e.g., /usr/bin/tput ${1:+-T$1} clear 2> /dev/null exit In 1989, when Keith Bostic revised the BSD tput command to make it similar to the AT&T tput, he added a shell script for the clear command: exec tput clear The remainder of the script in each case is a copyright notice. The ncurses clear command began in 1995 by adapting the original BSD clear command (with terminfo, of course). The E3 extension came later: o In June 1999, xterm provided an extension to the standard control sequence for clearing the screen. Rather than clearing just the vis- ible part of the screen using printf '33[2J' one could clear the scrollback using printf '33[3J' This is documented in XTerm Control Sequences as a feature originating with xterm. o A few other terminal developers adopted the feature, e.g., PuTTY in 2006. o In April 2011, a Red Hat developer submitted a patch to the Linux kernel, modifying its console driver to do the same thing. The Linux change, part of the 3.0 release, did not mention xterm, although it was cited in the Red Hat bug report (#683733) which led to the change. o Again, a few other terminal developers adopted the feature. But the next relevant step was a change to the clear program in 2013 to incorporate this extension. o In 2013, the E3 extension was overlooked in tput with the "clear" parameter. That was addressed in 2016 by reorganizing tput to share its logic with clear and tset. PORTABILITY
Neither IEEE Std 1003.1/The Open Group Base Specifications Issue 7 (POSIX.1-2008) nor X/Open Curses Issue 7 documents tset or reset. The latter documents tput, which could be used to replace this utility either via a shell script or by an alias (such as a symbolic link) to run tput as clear. SEE ALSO
tput(1), terminfo(5) This describes ncurses version 6.1 (patch 20180127). clear(1)
All times are GMT -4. The time now is 10:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy