-   Linux - General (
-   -   can somebody help me in fixing the script (

jdara1 10-23-2003 12:05 PM

can somebody help me in fixing the script
I have got one requirement, this script works in AIX but not in linux can somebody fix this problem.

Here is the script.

[u01pms20@u060ms20 scripts]$ cat


if [ -f [cdtl0-9][0-9][0-9][0-9]*([0-9]).[0-9][0-9][0-9] ]; then
echo "yes"

[u01pms20@u060ms20 scripts]$ touch 1234.000

[u01pms20@u060ms20 scripts]$ ./
./ line 4: syntax error near unexpected token `[cdtl0-9][0-9][0-9][0-9]*(['
./ line 4: `if [ -f [cdtl0-9][0-9][0-9][0-9]*([0-9]).[0-9][0-9][0-9] ]; then'

But the same script works in AIX box.

u060win3 stg /tmp>cat

if [ -f [cdtl0-9][0-9][0-9][0-9]*([0-9]).[0-9][0-9][0-9] ]; then
echo "yes"

u060win3 stg /tmp>touch 1234.000
u060win3 stg /tmp>./

Infact in Linux, when I change the script header to #!/bin/ksh
then I get this error
[u01pms20@u060ms20 scripts]$ ./
./[6]: [: 12345.000: unexpected operator/operand

Whether it is korn or bash , I am getting error in linux, can some gurus help me out. Once this is fixed, I am going to implement this login in a big script.


trickykid 10-23-2003 12:12 PM

Probably can't help without more details or more of the script included as I have no idea what your trying to accomplish with a simple:


if [ -f [cdtl0-9][0-9][0-9][0-9]*([0-9]).[0-9][0-9][0-9] ]; then
echo "yes"

What is that suppose to do and where?

Also, Linux is not AIX so path's and files can make a difference in referencing them on different systems, etc.

trickykid 10-23-2003 12:18 PM

Closed, part of a triple post. You can reply to his original one here:

All times are GMT -5. The time now is 08:17 AM.