LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-01-2004, 03:02 AM   #1
dolphs
Member
 
Registered: Nov 2003
Posts: 52

Rep: Reputation: 15
solaris: newbee starts scripting


Hi, currently I am playing with the solaris system running bash as shell.

putting the following lines in VI gives me the following error:

SCRIPT
for (( i=1; i<=5; i++ ))
do
for (( j=1; j<=i; j++ ))
do
echo -n " *"
done
echo ""
done

ERROR
./stars: line 1: syntax error near unexpected token `(('
./stars: line 1: `For (( i=1; i<=5; i++ ))'

Started with ./[file], sh [file] but cannot get it running. What to do to get it running?

Cheers
 
Old 04-01-2004, 03:57 PM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
put this line at the beginning of your script:

#!/opt/sfw/bin/bash

fix the path if bash isn't installed in /opt/sfw/bin
 
  


Reply



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
Yet another Newbee ? Sparkalinda Mandriva 1 02-17-2005 08:08 PM
Best os for a newbee?? eastsidecrew Linux - Newbie 10 04-21-2004 01:22 PM
newbee help p4 mcslinux Mandriva 3 10-23-2003 11:21 AM
For a newbee, cause newbee is a friend, and we must take care of friends. neo77777 Linux - Newbie 4 01-20-2002 12:01 AM
newbee MISTER_HEKTO Linux - Newbie 1 10-26-2001 11:29 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:10 PM.

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