Sponsored Content
Top Forums Shell Programming and Scripting Need assistance to resolve the KSH issue Post 302371714 by sathik on Monday 16th of November 2009 05:34:29 AM
Old 11-16-2009
Need assistance to resolve the KSH issue

am running the small script below.

count_a=48
count_b=48
if [$count_a -eq $count_b]; then
echo "Count matched"
else
echo "count not matched"
fi

I got the below output.

/bin/ksh: [48: not found
count not matched

It was giving the same error when I ran in another box. But I inculded /bin/ksh in the 1st line. Then It was working fine.
But same way I followed here also. even it is giving error.

And I tried the way also as I added #!/bin/ksh in the 1st line. But not favour.

my /bin/*sh output is given below.

-rwxr-xr-x 1 root other 703 Dec 16 2004 /bin/gnome-autogen.sh
-r-xr-xr-x 17 root bin 134 Jan 21 2005 /bin/hash
-r-xr-xr-x 1 root bin 735572 Jan 23 2005 /bin/bash
-r-------- 1 root bin 27752 Jan 23 2005 /bin/rsh
-r-xr-xr-x 2 root bin 159592 Jan 23 2005 /bin/pfcsh
-r-xr-xr-x 2 root bin 159592 Jan 23 2005 /bin/csh
-r-xr-xr-x 3 root bin 209256 Jan 23 2005 /bin/rksh
-r-xr-xr-x 3 root bin 209256 Jan 23 2005 /bin/pfksh
-r-xr-xr-x 3 root bin 209256 Jan 23 2005 /bin/ksh
-r-xr-xr-x 1 root bin 257288 Jan 23 2005 /bin/ssh
-r-xr-xr-x 1 root bin 363280 Jan 23 2005 /bin/tcsh
lrwxrwxrwx 1 root root 13 Jan 11 2006 /bin/jsh -> ../../sbin/sh
lrwxrwxrwx 1 root root 13 Jan 11 2006 /bin/pfsh -> ../../sbin/sh
lrwxrwxrwx 1 root root 13 Jan 11 2006 /bin/sh -> ../../sbin/sh
lrwxrwxrwx 1 root root 5 Jan 11 2006 /bin/remsh -> ./rsh
lrwxrwxrwx 1 root root 14 Jan 11 2006 /bin/zsh -> ../sfw/bin/zsh
lrwxrwxrwx 1 root other 28 Mar 2 2006 /bin/rpccp.sh -> /opt/OV/dce/bin_exe/rpccp.sh


Pls help me.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

KSH Script Assistance

Hey everyone, I'm newer than new when it comes to this ksh and scripting stuff, and unix in general. I have been thrown into a task at work that A: They expect me to come up to speed on, B: Show I can do this. (Program for the workgroup) Here's the script, part of it, from the overall... (3 Replies)
Discussion started by: Brusimm
3 Replies

2. UNIX for Dummies Questions & Answers

Can any good awk'er resolve this issue?

awk -F^ '{ if ((($1 != "M") && ($5 != "2")) || (($1 != "S") && ($5 != "7"))) print $0}' welcome > welcome1 The "&&" and "||" in the above command is not working with awk. When I run the above command, the same content of welcome is copied to welcome1 without any difference. Your reply is... (12 Replies)
Discussion started by: karthickrn
12 Replies

3. Shell Programming and Scripting

basename issue with ksh

I have a function name called help as below function help { echo "Run the script as," #echo "$(basename $0) -sod or -eod" echo "${0##*/} -sod or -eod" } and have case stmt which will call this function incase of wrong parameter but when ever I'm giving wrong... (2 Replies)
Discussion started by: manas_ranjan
2 Replies

4. Shell Programming and Scripting

ksh: How do I resolve ip addr in a text file?

Hi, I need to resolve IP to names in a text file. I was thinking of using some unix commands. Ksh. Text in file contains a lot of these entries: .. 20 6 <166>%ASA-6-302013: Built inbound TCP connection 12690562 for inside2:10.86.6.20/3678 (10.86.6.20/3678) to inside:10.107.22.12/1947... (3 Replies)
Discussion started by: hasselhaven
3 Replies

5. Shell Programming and Scripting

Need assistance with a file issue and a terminal issue

Hello everyone, I'm in need of some assistance. I'm currently enrolled in an introductory UNIX shell programming course and, well halfway through the semester, we are receiving our first actual assignment. I've somewhat realized now that I've fallen behind, and I'm working to get caught up, but for... (1 Reply)
Discussion started by: MrMagoo22
1 Replies

6. Shell Programming and Scripting

-z in ksh issue

Hi, Can any body please tell me what does -z do in ksh? I need to understand what does below code do? FILE_LIST is an array which store multiple number of files... if } ]]; then echo "EVDO file not found fi I hope I'm clear on my query (3 Replies)
Discussion started by: annybase
3 Replies

7. Solaris

Cannot resolve PTR record issue

Hi guys, I am currently receiving the following output in /var/log/syslog and is occurring every second leading to /var directory being full after every 2 days. Aug 20 17:32:29 opaldn1 sendmail: r7KCOlQm002517: ruleset=check_rcpt, arg1=<postmaster@silverapp6>, relay=, reject=450 4.4.0... (3 Replies)
Discussion started by: Junaid Subhani
3 Replies

8. Shell Programming and Scripting

Need assistance in ksh script

requirement : I need to read a text file and find out which particular line has highest charcters on it using the shell script. I tried & was able to find out only for one line. I could not able to find out for the entire the line. sed -n '10 p' ctstest.sh | wc -w Please guide me... (5 Replies)
Discussion started by: ramkumar15
5 Replies

9. Shell Programming and Scripting

ksh while read issue

Hello, I have used a chunk of ksh script similar to this in many places without any issue: while : do print; read OPTION?"Enter a number (q to quit): " expr ${OPTION} + 1 >/dev/null 2>&1 CHECKVAL=$? if }" != ${OPTION} ]; then ... (2 Replies)
Discussion started by: port43
2 Replies
GZEXE(1)						      General Commands Manual							  GZEXE(1)

NAME
gzexe - compress executable files in place SYNOPSIS
gzexe name ... DESCRIPTION
The gzexe utility allows you to compress executables in place and have them automatically uncompress and execute when you run them (at a penalty in performance). For example if you execute ``gzexe /usr/bin/gdb'' it will create the following two files: -rwxr-xr-x 1 root root 1026675 Jun 7 13:53 /usr/bin/gdb -rwxr-xr-x 1 root root 2304524 May 30 13:02 /usr/bin/gdb~ /usr/bin/gdb~ is the original file and /usr/bin/gdb is the self-uncompressing executable file. You can remove /usr/bin/gdb~ once you are sure that /usr/bin/gdb works properly. This utility is most useful on systems with very small disks. OPTIONS
-d Decompress the given executables instead of compressing them. SEE ALSO
gzip(1), znew(1), zmore(1), zcmp(1), zforce(1) CAVEATS
The compressed executable is a shell script. This may create some security holes. In particular, the compressed executable relies on the PATH environment variable to find gzip and some standard utilities (basename, chmod, ln, mkdir, mktemp, rm, sleep, and tail). BUGS
gzexe attempts to retain the original file attributes on the compressed executable, but you may have to fix them manually in some cases, using chmod or chown. GZEXE(1)
All times are GMT -4. The time now is 06:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy