What is wrong with this script?

Tags
shell scripts

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 06: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

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Similar Threads More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
What's wrong with the following script jediwannabe Shell Programming and Scripting 2 04-25-2013 08:28 PM
Why result is wrong here ? whether break statement is wrong ? Akshay Hegde Shell Programming and Scripting 2 03-11-2013 12:31 AM
What is wrong with my script? littlewenwen Shell Programming and Scripting 3 03-03-2013 12:18 AM
Can anyone tell me what's wrong with my script Akshay Hegde Shell Programming and Scripting 5 02-13-2013 01:28 AM
What's wrong on this script? kotsos13 UNIX for Dummies Questions & Answers 7 12-19-2011 06:57 PM
What is wrong with this script tt1611 Shell Programming and Scripting 9 09-09-2011 10:54 AM
ps script - What is wrong with it please? linuxrose Shell Programming and Scripting 1 04-03-2011 11:12 AM
What's wrong with my script .... heyitsmeok Shell Programming and Scripting 7 05-21-2010 11:32 AM
Script Gone Wrong ibzee33 Shell Programming and Scripting 14 05-16-2010 04:44 AM
what is wrong with this script? rs1969 UNIX for Dummies Questions & Answers 2 11-15-2007 07:16 AM
what is wrong with this script? hankooknara Shell Programming and Scripting 8 06-09-2007 01:33 PM
What is wrong with this script? heprox Shell Programming and Scripting 8 11-16-2006 05:43 AM
something wrong with this script?? fusion76 Shell Programming and Scripting 2 02-01-2005 01:24 AM
what is wrong with this script? circleW Shell Programming and Scripting 2 09-28-2004 09:27 PM
What is wrong with this script? borncrazy Shell Programming and Scripting 5 07-20-2004 11:51 AM
All times are GMT -4. The time now is 05:45 PM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.