Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


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

Rep: Reputation: 0
how to fix this 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 logic in a big script.

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

Rep: Reputation: 261Reputation: 261Reputation: 261
Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.

I answered this in Linux - General already. Did you read the rules when registering? I'm 100% sure you saw them as there is no way around them...

Anyone that wants to reply to this thread, do it here:


[edit]Actually you tripled posted this, replied to the very first one that you recieved replies to but yet, still posted the same question again. Shame on you.... [/edit]

Last edited by trickykid; 10-23-2003 at 12:17 PM.

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Iptables (with masq) troubleshooting, very simple script attached script and logs. xinu Linux - Networking 13 11-01-2007 04:19 AM
all attempts to fix the problem failed... can someone help me fix partition space? foreverdita Linux - Enterprise 2 05-11-2005 09:02 AM
reiserfsck --fix-fixable -> --fix-fixable ignored - why? BrianK Linux - Software 1 01-07-2005 08:45 PM
send automatic input to a script called by another script in bash programming jorgecab Programming 2 04-01-2004 12:20 AM
help requd to fix this script problem jdara1 Linux - Software 5 10-24-2003 07:52 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:44 AM.

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
Open Source Consulting | Domain Registration