👤
Home Man
Search
Today's Posts
Register

BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

What is wrong with this script?

👤 Login to reply

 
Thread Tools Search this Thread
# 1  
Old 05-12-2011
What is wrong with this script?

I write this script and do not no whrer the wrong!!
Can anyone hlep me?

#=========================================
Script Name: shell_script1
#=========================================
Code:
looptrack=y
while [ “$looptrack” = 1 ]
do
echo -n “Type in the account number:” read account
echo -n “Type the first and last name:” ; read full_name
echo -n “Type the age:” red age
echo -n “Enter another record?” ; read looptrack
finish

# 2  
Old 05-12-2011
- looptrack is initialised to y instead of 1
- Use done instead of finish.
- Use regular " instead of and
-
Use read instead of red
- Separate commands by newline or semicolon

Last edited by Scrutinizer; 05-12-2011 at 05:18 AM..
# 3  
Old 05-12-2011
Code:
while condition; do
    ...
done

and your double quotes look strange...

if looptrack = 'y' then looptrack != '1' !!! because 'y' != '1'
# 4  
Old 05-12-2011
The slandy quotes “ ” look like they have come from Microsoft Word and are not valid in a unix script. They should be standard double quotes " " . You need to be using a unix editor to create a unix script file in the correct character set.

After taking into account the advice from various posters, please post the new version and show what happens when you execute the script. It is hard to suggest changes without knowing what the script is designed to do.
👤 Login to reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Why result is wrong here ? whether break statement is wrong ? Akshay Hegde Shell Programming and Scripting 2 03-10-2013 11:31 PM
What's wrong on this script? kotsos13 UNIX for Dummies Questions & Answers 7 12-19-2011 05:57 PM
What is wrong with this script tt1611 Shell Programming and Scripting 9 09-09-2011 09:54 AM
What's wrong with my script .... heyitsmeok Shell Programming and Scripting 7 05-21-2010 10:32 AM
what is wrong with this script? Mike1234 Shell Programming and Scripting 2 02-10-2009 11:45 AM
what is wrong with this script? hankooknara Shell Programming and Scripting 8 06-09-2007 12:33 PM
What is wrong with this script? heprox Shell Programming and Scripting 8 11-16-2006 04:43 AM
something wrong with this script?? fusion76 Shell Programming and Scripting 2 02-01-2005 12:24 AM
what is wrong with this script? circleW Shell Programming and Scripting 2 09-28-2004 08:27 PM
What is wrong with my script? Lem2003 UNIX for Dummies Questions & Answers 6 05-29-2003 01:17 AM


All times are GMT -4. The time now is 10:43 AM.

Unix & Linux Forums Content Copyright©1993-2018. All Rights Reserved.
×
UNIX.COM Login
Username:
Password:  
Show Password





Not a Forum Member?
Forgot Password?