The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Simple Array in Ksh Scripting ravikirankethe UNIX for Dummies Questions & Answers 2 11-01-2006 08:35 AM
HELP me PLS... Simple Scripting! liezer Shell Programming and Scripting 2 09-14-2006 06:50 AM
simple scripting question gennaro Shell Programming and Scripting 3 06-16-2005 11:49 PM
Help with simple scripting actions Nads Shell Programming and Scripting 5 04-28-2005 08:42 PM
any tutorials on simple scripting? xyyz UNIX for Dummies Questions & Answers 3 03-13-2003 10:31 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 03-26-2007
Registered User
 

Join Date: Mar 2007
Posts: 1
Unhappy Very simple argument in scripting question

I tried to do a search, but it couldnt pinpoint what my answer since using limited but broad keywords. Sorry in advance ; ;

Im limited to using Bourne shell scripting only, atm I have the following code (just the heading part of it)


Code:
...
...
# VARIABLE DECLARATION
# ====================

lineCount=1
eofFlag=0
matched=0

# Ask for player name

echo -n "Player name? "       # < problems with this
# and store it to the variable
read srcStr
...
...

read -n1 keyPress                # < problems with this

...
...
first my echo is showing the -n, and second my read is giving me "is not an identifier" error msg. I tried both echo -n and read -n1 in plain shell environment (non-scripting) and it works fine. But why it wont work when i put them in scripting file. And what are my alternatives?

Thanks for any help.... Couldnt find any answer to my question in google, and I'm stuck and desperate.
Reply With Quote
Forum Sponsor
  #2  
Old 03-26-2007
Registered User
 

Join Date: Feb 2007
Posts: 44
Hi,
If possible can you post the full source....atleast from first line of ur script till the line where you get the first error..
I can take a look into it.

Thanks
Raghuram
Reply With Quote
  #3  
Old 03-26-2007
Dhruva's Avatar
Registered User
 

Join Date: Mar 2006
Location: India
Posts: 255
yes as raghram said pasting full source will help.
The echo is printing -n on screen means you dont have -n option available so you can use \c(escape seq) to solve the same prob.
Code:
echo "this is test\c"
read x
will do same as
Code:
echo -n "this is test"
read x
pls note read -n option is available with ksh shell and echo -n is with csh.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:12 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0