Sponsored Content
Full Discussion: if else fi error in ksh
Top Forums Shell Programming and Scripting if else fi error in ksh Post 302522160 by purdym on Friday 13th of May 2011 12:23:29 PM
Old 05-13-2011
Did you define ASP_SH as a function?

Use [[ 1 -eq 1 ]].

Did you remove all the semi colons?

---------- Post updated at 11:23 AM ---------- Previous update was at 11:18 AM ----------

Updated and tested:

Code:
root@ms:/>cat /tmp/a
#!/usr/bin/ksh

while [[ 1 -eq 1 ]]
do
   check=$(ps -ef | egrep -v "ps|grep" | grep -ic ksh93)
   if [[ $check -ge 1 ]]
   then
      echo "Process is running."

   else
      echo "Process is not running."

   fi

   sleep 10

done
root@ms:/>/tmp/a
Process is running.
Process is running.

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ksh with bc command error

Hi, I don't understand why the below code gave me error message: worked: not found I am using ksh program. worked =`/usr/ucb/echo "scale=2; ($logend-$logstart)/3600" | bc` Thank you very much for your help! (1 Reply)
Discussion started by: cin2000
1 Replies

2. UNIX for Dummies Questions & Answers

Ksh error

I am running the below script to call an already existing concurrent program using the CONCSUB utility. #!/bin/ksh echo "==================================================" echo "Beginning program " `date "+%m/%d/%y %H:%M:%S"` "\n" echo "=================================================" #... (1 Reply)
Discussion started by: Begins
1 Replies

3. Shell Programming and Scripting

error in ksh script

Hi, i am facing an error in the following script in the korn shell but in bash it is working , can any help me to convert the below script to korn shell script without errors. echo 123.4566 | bc -l | awk -F '.' '{ print $1; exit; }' Thanks in advance kamal (5 Replies)
Discussion started by: G.K.K
5 Replies

4. Shell Programming and Scripting

du command error in ksh

Hi, i am facing an error in the korn shell by executing the following script, can anyone help me out in solving the error.. Note: /root/kamal is a directory size_dir=$(du -s /root/kamal | cut -f1) echo $size_dir error: invalid $ at ( in size_dir Thanks &... (2 Replies)
Discussion started by: G.K.K
2 Replies

5. Shell Programming and Scripting

expr error in ksh

Hi ALL, i am so much confused y the following script is not working in the korn shel which works in bash shell. please solve the error that i am facing. i want to extract the format of the size from a variable i.e. GB or KB or MB or B or BYTES code: -------- size_dir_pass=1.2gb... (2 Replies)
Discussion started by: G.K.K
2 Replies

6. Shell Programming and Scripting

KSH - Selection Sort Error

I have 'translated' selection sort from java to KSH, here is my code #1. get the inputs and put into arr print "Enter the integers (separated by a space):" read integers set -A arr $integers #2. start sorting process, using selection sort min=0 tmp=0 i=0 while test $i -lt... (2 Replies)
Discussion started by: laduch
2 Replies

7. Ubuntu

ksh error

hi, When I try to go to het ksh shell i get het errror below. Deleting, reinstalling via apt-get does'nt work. Manually deleting and then reinstalling also does'nt work. Any seen this error before? ksh ksh: error while loading shared libraries: libdll.so: cannot open shared object file:... (1 Reply)
Discussion started by: jld
1 Replies

8. Shell Programming and Scripting

Receiving error: ./ang.ksh[35]: 0403-057 Syntax error at line 116 : `done' is not expected.

Hi All I am quite new to Unix. Following is a shell script that i have written and getting the subject mentioned error. #!/bin/ksh #------------------------------------------------------------------------- # File: ang_stdnld.ksh # # Desc: UNIX shell script to extract Store information.... (3 Replies)
Discussion started by: amitsinha
3 Replies

9. Shell Programming and Scripting

KSH syntax error

Hi all, Anyone know why I get the error below under ksh? $ EXCLUDES=( $(< "$EXCLUDES_FILE") ) sh: syntax error: `(' unexpected I'm trying to use the above line in a script and it's not working. The guy that gave me the script was running in a linux environment, so I'm thinking this might... (1 Reply)
Discussion started by: mmw
1 Replies

10. UNIX for Beginners Questions & Answers

Error with while loop ksh

while ];do first=${hat} echo "${first}" b=$((b+1)) a=$((a+5)) done I'm trying to append values from the indicated index of one array to other, but it gives me an error with while loop....suggesting that ....... In the hat array, it contains many values... (2 Replies)
Discussion started by: TestKing
2 Replies
UNBUFFER(1)						      General Commands Manual						       UNBUFFER(1)

NAME
unbuffer - unbuffer output SYNOPSIS
unbuffer program [ args ] INTRODUCTION
unbuffer disables the output buffering that occurs when program output is redirected from non-interactive programs. For example, suppose you are watching the output from a fifo by running it through od and then more. od -c /tmp/fifo | more You will not see anything until a full page of output has been produced. You can disable this automatic buffering as follows: unbuffer od -c /tmp/fifo | more Normally, unbuffer does not read from stdin. This simplifies use of unbuffer in some situations. To use unbuffer in a pipeline, use the -p flag. Example: process1 | unbuffer -p process2 | process3 CAVEATS
unbuffer -p may appear to work incorrectly if a process feeding input to unbuffer exits. Consider: process1 | unbuffer -p process2 | process3 If process1 exits, process2 may not yet have finished. It is impossible for unbuffer to know long to wait for process2 and process2 may not ever finish, for example, if it is a filter. For expediency, unbuffer simply exits when it encounters an EOF from either its input or process2. In order to have a version of unbuffer that worked in all situations, an oracle would be necessary. If you want an application-specific solution, workarounds or hand-coded Expect may be more suitable. For example, the following example shows how to allow grep to finish pro- cessing when the cat before it finishes first. Using cat to feed grep would never require unbuffer in real life. It is merely a place- holder for some imaginary process that may or may not finish. Similarly, the final cat at the end of the pipeline is also a placeholder for another process. $ cat /tmp/abcdef.log | grep abc | cat abcdef xxxabc defxxx $ cat /tmp/abcdef.log | unbuffer grep abc | cat $ (cat /tmp/abcdef.log ; sleep 1) | unbuffer grep abc | cat abcdef xxxabc defxxx $ BUGS
The man page is longer than the program. SEE ALSO
"Exploring Expect: A Tcl-Based Toolkit for Automating Interactive Programs" by Don Libes, O'Reilly and Associates, January 1995. AUTHOR
Don Libes, National Institute of Standards and Technology 1 June 1994 UNBUFFER(1)
All times are GMT -4. The time now is 05:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy