The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
how to make this work rider29 Shell Programming and Scripting 1 06-05-2008 02:22 PM
how can make if [ $f1 -nt $f2 ] works in solaries mail2sant Shell Programming and Scripting 2 04-17-2008 06:55 AM
my sound card doesn't work under solaries 10 ramy_feteha SUN Solaris 1 01-21-2008 03:42 PM
How to make this work heru_90 Shell Programming and Scripting 3 09-07-2006 12:04 AM
nohup--how to make it work? abhijeetkul Shell Programming and Scripting 1 10-29-2005 11:48 AM

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 04-14-2008
mail2sant mail2sant is offline
Registered User
  
 

Join Date: Apr 2008
Location: bangalore
Posts: 67
how to make ksh to work on solaries

i have a script i which i am using

#!/bin/ksh
todate=$(date +%m%d%y)
dir="$dir/port${todate}"

the above one works in linux ...ut not working in solaries

could some one please help me in that
  #2 (permalink)  
Old 04-14-2008
radoulov's Avatar
radoulov radoulov is online now Forum Staff  
addict
  
 

Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 2,873
What's the error you get?
  #3 (permalink)  
Old 04-14-2008
mail2sant mail2sant is offline
Registered User
  
 

Join Date: Apr 2008
Location: bangalore
Posts: 67
: syntax error at line 25: `todate=$' unexpected

is the error i am getting
  #4 (permalink)  
Old 04-14-2008
radoulov's Avatar
radoulov radoulov is online now Forum Staff  
addict
  
 

Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 2,873
Quote:
Originally Posted by mail2sant View Post
: syntax error at line 25: `todate=$' unexpected

is the error i am getting
It's because you're using the old sh ([usr]/bin/sh):

Code:
$ uname -a
SunOS ess038 5.8 Generic_117350-02 sun4u sparc SUNW,Ultra-60
$ ps -p$$
   PID TTY      TIME CMD
 17394 pts/6    0:00 ksh
$ todate=$(date +%m%d%y)
$ sh
$ todate=$(date +%m%d%y)
syntax error: `todate=$' unexpected
You should use ksh.

P.S. Try starting the script as ./scriptname.
  #5 (permalink)  
Old 04-14-2008
mail2sant mail2sant is offline
Registered User
  
 

Join Date: Apr 2008
Location: bangalore
Posts: 67
uname -a
SunOS schi0133pap 5.8 Generic_108528-14 sun4u sparc SUNW,Sun-Fire-280R

still i am not getting

could u please help me.. how to rectify it
  #6 (permalink)  
Old 04-14-2008
mail2sant mail2sant is offline
Registered User
  
 

Join Date: Apr 2008
Location: bangalore
Posts: 67
uname -a
SunOS schi0133pap 5.8 Generic_108528-14 sun4u sparc SUNW,Sun-Fire-280R

still i am not getting

could u please help me.. how to rectify it
  #7 (permalink)  
Old 04-14-2008
radoulov's Avatar
radoulov radoulov is online now Forum Staff  
addict
  
 

Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 2,873
Quote:
Originally Posted by mail2sant View Post
uname -a
SunOS schi0133pap 5.8 Generic_108528-14 sun4u sparc SUNW,Sun-Fire-280R

still i am not getting

could u please help me.. how to rectify it
If you post the commands and the entire output using code tags it will be easier.
Closed Thread

Bookmarks

Tags
linux

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 11:55 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