The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Funny but true.... naushad UNIX for Dummies Questions & Answers 6 03-26-2008 06:23 AM
how to exit a while true loop Noob e Shell Programming and Scripting 5 08-26-2007 03:44 PM
is it true or not dhlopomo UNIX for Dummies Questions & Answers 4 08-16-2007 10:54 AM
why isn't the exit status true? mjays Shell Programming and Scripting 5 04-04-2007 10:18 AM
True Shutdown help! 01000101 UNIX for Dummies Questions & Answers 3 05-15-2006 08:36 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-16-2005
krishna krishna is offline
Registered User
  
 

Join Date: Aug 2001
Posts: 60
ksh [ HP True 64 v5.1 ] and HP-UX B.11.11i

Hi Friends,

We have migrated our Unix from HP True 64 v5.1 to HP-UX B.11.11i recently and copied all my shell scripts ( Korn shell ) to new HP-UX B.11.11i unix machine. I've encountered lot of errors during execution of the scripts for example:

cat x.sh
#!/usr/bin/ksh
if [ -f abc.txt ]
then
echo abc.txt file exists...
else
echo abc.txt file does not exists...
fi

===============
x.sh: test: argument expected
abc.txt file does not exists...

In my old machine there were no problems, pls advise with how can I overcome from this kind of problems.

Thanks
Krishna
  #2 (permalink)  
Old 09-16-2005
krishna krishna is offline
Registered User
  
 

Join Date: Aug 2001
Posts: 60
Suppose if I copy ksh file from old machine into my $HOME/bin will it works and how is its behavior?
  #3 (permalink)  
Old 09-16-2005
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
ksh should be fairly constant across operating systems. The code that you have posted worked fine in FreeBSD. And no, you cannot just take a binary from Tru64 and expect it to work on HP.
  #4 (permalink)  
Old 12-19-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,127
I tried that script on ab HP-UX 11i system and I cannot reproduce the error. It works fine for me.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:05 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0