LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Closed Thread
  Search this Thread
Old 10-23-2003, 12:08 PM   #1
jdara1
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 t.ss

#!/bin/bash


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

[u01pms20@u060ms20 scripts]$ touch 1234.000

[u01pms20@u060ms20 scripts]$ ./t.ss
./t.ss: line 4: syntax error near unexpected token `[cdtl0-9][0-9][0-9][0-9]*(['
./t.ss: 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 t.ss
#!/bin/ksh


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

u060win3 stg /tmp>touch 1234.000
u060win3 stg /tmp>./t.ss
yes

Infact in Linux, when I change the script header to #!/bin/ksh
then I get this error
[u01pms20@u060ms20 scripts]$ ./t.ss
./t.ss[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.

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

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

http://www.linuxquestions.org/rules.php

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: http://www.linuxquestions.org/questi...hreadid=106830

DON'T REPLY TO THIS THREAD AS IT WILL BE CLOSED.

[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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:55 AM.

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