Hi,
We are using AIX and while using KSH Unix script, we are reading data in a file and then using the if statement for comparison. The code with if statement is as follows;
The code is working fine and writing the data to the file "outfile", but the code gives errors. The errors are when the characters are "empty" or "blank" then while comparing the system is giving errors as follows;
ksh: _: unknown test operator
ksh: test: argument expected
Please help to have the code without having error messages. I would also like to know if there is a better way of doing this.
Thanks for the help.
can anyone point me to a comparison of *nix file systems ?
i think i prefer a journalling fs
but i would like to see a comparison between several fs's before i make up my mind (2 Replies)
Just a quick question:
if I want to do a comparison with a wildcard in a shell script, do i just use '*'? Heres what I have:
elif ; then
continue
but that doesnt evaluate right. It tries to compare against the literal '/apps*' instead of anything that begins with '/apps' (2 Replies)
I need some help which would probably be for most of you a simple script.
I need to read in the data from a .dat file and then compare avg to see who is the highest avg. Here is my script so far.
#!/bin/ksh
#reading in the data from lab3.dat
filename=$1
while read name o1 o2 o3 o4 o5 o6... (0 Replies)
In my ksh script, if the conditions of a if statement are true, then do nothing; otherwise, execute some commands.
How do I write the "do nothing" statement in the following example?
Example:
if (( "$x"="1" && "$y"="a" && "$z"="happy" ))
then
do nothing
else
command
command
fi... (3 Replies)
Hi All,
I am using Unix ksh script.
I need to insert values to a table using the o/p from a slelect statement.
Can anybody Help!
My script looks like tihs.
---`sqlplus -s username/password@SID << EOF
set heading off
set feedback off
set pages 0
insert into ${TB_NAME}_D... (2 Replies)
Hi
Just trying to compare the following variables as a condition in an 'if' statement.
ZERODATA="unidentified 0 b (0%)"
DATA=`sed -n "${dln} p" mpck2.out`
...
if
then
...
The problem I'm getting is that the condition always comes out true and doesn't appear to compare them... (5 Replies)
hi guys
i need a program that can compare a value read from a com-port and one from the terminal.
can somebody help me???
using linux kernel 2.6.14-M5
can only use standard function in sh and bash... (5 Replies)
Hello folks,
I have two files, which have usernames, I want to see the contents of file1.txt which is missing in file2.txt and another comparison file2.txt contents which is missing in file1.txt. please suggest.
file1.txt
user
u2
u8
a9
p9
p3
u4
z8
aaa
ahe
oktlo (7 Replies)
Hi folks,
I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex.
I have a bunch of update statements with all columns in a file which I need to convert into insert statements.
UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Discussion started by: dev123
0 Replies
LEARN ABOUT DEBIAN
shcomp
SHCOMP(1) User Environment Utilities SHCOMP(1)NAME
shcomp - compile a ksh93 shell script
SYNOPSIS
shcomp [ options ] [infile] [outfile]]
ORIGIN OF THIS MAN PAGE
This man page was written by Christophe Martin <Schplurtz@free.fr> for the Debian GNU/Linux system. It is based on "shcomp --man" output.
DESCRIPTION
Unless -D is specified, shcomp takes a shell script, infile, and creates a binary format file, outfile, that ksh93 can read and execute
with the same effect as the original script.
Since aliases are processed as the script is read, alias definitions whose value requires variable expansion will not work correctly.
If -D is specified, all double quoted strings that are preceded by $ are output. These are the messages that need to be translated to
locale specific versions for internationalization.
If outfile is omitted, then the results will be written to standard output. If infile is also omitted, the shell script will be read from
standard input.
OPTIONS -D, --dictionary
Generate a list of strings that need to be placed in a message catalog for internationalization.
-n, --noexec
Displays warning messages for obsolete or non-conforming constructs.
-v, --verbose
Displays input from infile onto standard error as it reads it.
--man Displays this man page on standard error and exits.
--help Shows a short help message and exits.
EXIT STATUS
0 Successful completion.
>0 An error occurred.
DEBIAN WARNING
On a Debian GNU/Linux system, more than one package may provide ksh. the output of shcomp can only be used by ksh93. Any other ksh will be
unable to run the compiled script.
EXAMPLE
( echo '#! /bin/ksh93' ; shcomp myscript ) > myscript.bin &&
chmod 755 myscript.bin
./myscript.bin
SEE ALSO ksh(1)IMPLEMENTATION
version shcomp (AT&T Labs Research) 2012-02-29
author David Korn <dgk@research.att.com>
copyright Copyright (c) 1982-2012 AT&T Intellectual Property
license http://www.eclipse.org/org/documents/epl-v10.html
KSH93 Fri Jun 3 2005 SHCOMP(1)