Ksh Shell Script Error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Ksh Shell Script Error
# 1  
Old 11-18-2011
Ksh Shell Script Error

Hi,
While running below code i am getting error as below
0403-004 Specify a parameter with this command.
Please look it below code and let me know about if condition.

Code is As below
Code:
#!/usr/bin/ksh
Infa_Src_Dir=$DIR/SrcFiles/pp
Load_Info_Lst_Path=$DIR/SrcFiles/pp
Quarter_Info="QUARTER_LOAD.lst"
Quarter_Info_temp="Quarter_Load_temp.lst"
QTYR=`head -1 ${Infa_Src_Dir}/${Quarter_Info}`
if test -s ${Infa_Src_Dir}/${Quarter_Info_temp}
then
  rm ${Infa_Src_Dir}/${Quarter_Info_temp}
fi
while read filelist
do
  echo $filelist
  if [ ${filelist} !=${QTYR} ]
  then
    echo ${filelist}>${Infa_Src_Dir}/${Quarter_Info_temp}
  fi
done<${Infa_Src_Dir}/${Quarter_Info}
# cp ${Infa_Src_Dir}/${Quarter_Info_temp} {Infa_Src_Dir}/${Quarter_Info}

Thanks,
Samadhan

Last edited by Scott; 11-18-2011 at 06:39 AM.. Reason: Added code tags
# 2  
Old 11-18-2011
Code:
if [ ${filelist} !=${QTYR} ]

needs a space after the !=
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with ksh Shell Script

My goal is to create a script that will check if in a test or production environment. I wrote this script to check $host variable to check which server I'm on but this script does not work. if then BASE=/home/fmtest; export BASE else BASE=/home/fmprod; export BASE fi ... (5 Replies)
Discussion started by: Bperl1967
5 Replies

2. Shell Programming and Scripting

Help with KSH Shell Script

From a shell script I'm trying to remove the first two files of whats returned from the head -2 command so I tried piping it to xargs rm -f but I can't get it to work. How do I remove the files from the head command? ls -al *clit* *servr* |sort -t_ -nk2 | head -2 |xargs rm -f (3 Replies)
Discussion started by: Bperl1967
3 Replies

3. UNIX for Dummies Questions & Answers

How do i lock a ksh shell script?

Hi, I have a ksh shell script that accesses databases to drop and create tables and the script also creates text files. This shell script is accessed thru a java application that i would like to turn multi-user, but the only way that i can do that is if I can figure out a way to lock the shell... (2 Replies)
Discussion started by: ndedhia1
2 Replies

4. Shell Programming and Scripting

Help with ksh shell script

Anyone know how to check a filename that contains a date and compare whiich file is older using a ksh shell script? The filename looks like aaaaa_20110615 (1 Reply)
Discussion started by: Bperl1967
1 Replies

5. Shell Programming and Scripting

How can I execute another shell from my ksh script?

I am newbie in UNIX, so please excuse me for the stupid question.:) Here is a problem: I created ksh script where the part of the functionality include an opening of a second session with another shell process "runrep"(runrep is a custom reporting shell designed by Advent Geneva). When I run my... (3 Replies)
Discussion started by: alexstar
3 Replies

6. Shell Programming and Scripting

what does this ksh shell script do?

Can someone tell me when the script is called, what does it do? I can't see it is going to run anything. (1 Reply)
Discussion started by: dp100022
1 Replies

7. Shell Programming and Scripting

Help with ksh shell script

I am using /usr/bin/ksh in AIX I am reading the values of $dbname, $dbatmpdir/dbdir.$$, and $scope from a different file All I have to do is check if $dbname exists in file $dbatmpdir/dbdir.$$ and $scope should have a value either 'TABLE' or 'SCHEMA'. When I execute the following code. I am... (3 Replies)
Discussion started by: tenderfoot
3 Replies

8. Shell Programming and Scripting

Awk in ksh shell script - help

Hello, Im a beginner. Im writing a ksh script with awk. Is it possible to assign the output of the awk to a shell variable? Like, shell_variable= awk '$1 == "shell" {abc= $2 }' /tmp/cust_det echo $shell_variable Please excuse my ignorance. Thanks in advance. (4 Replies)
Discussion started by: Nic_writes
4 Replies

9. Shell Programming and Scripting

Shell script run error ksh: not found

Hi All, I am trying to run a script to FTP files from one UNIX server to another UNIX server. Actually I can able to FTP file successfully by manually or paste whole script at prompt. But when I am trying to run script it is giving error. Please let me know the cause. #!/bin/sh... (3 Replies)
Discussion started by: nz80qy
3 Replies

10. Shell Programming and Scripting

ssh into a shell script (KSH)

Hi all, Just like to ask if it is possible to do the following: 1. Have a shell script that calls ssh username@destinationhost 2. Upon successful verification, we ssh into the destination host and automatically use ksh to run a shell script that resides in the destination host. (Hopefully no... (8 Replies)
Discussion started by: rockysfr
8 Replies
Login or Register to Ask a Question