LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

Closed Thread
 
Search this Thread
Old 10-23-2003, 12:05 PM   #1
jdara1
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 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 login in a big script.

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

Rep: Reputation: 199Reputation: 199
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:

Code:
if [ -f [cdtl0-9][0-9][0-9][0-9]*([0-9]).[0-9][0-9][0-9] ]; then
echo "yes"
fi
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
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Closed, part of a triple post. You can reply to his original one here: http://www.linuxquestions.org/questi...hreadid=106830
 
  


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 LinuxQuestions.org 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


All times are GMT -5. The time now is 05:53 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration