Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


Closed Thread
  Search this Thread
Old 10-23-2003, 12:05 PM   #1
LQ Newbie
Registered: May 2003
Posts: 9

Rep: Reputation: 0
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.

Old 10-23-2003, 12:12 PM   #2
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
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.
Old 10-23-2003, 12:18 PM   #3
LQ Guru
Registered: Jan 2001
Posts: 24,149

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

Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
fixing my mbr bernstein Linux - General 7 06-30-2005 10:24 PM
Fixing XP rml54321 Member Success Stories 2 09-16-2004 10:54 AM
fixing bugs jyotsna Red Hat 1 09-16-2004 07:44 AM
Fixing KMenu mc_03 Linux - Software 0 03-21-2004 11:50 PM
Need Help Fixing DSDT mds00 Linux - Laptop and Netbook 1 12-17-2003 09:04 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:03 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration