Home Man
Today's Posts

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?

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
while [ “$looptrack” = 1 ]
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

# 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
while condition; do

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 is wrong with my script? littlewenwen Shell Programming and Scripting 3 03-02-2013 11:18 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
Script Gone Wrong ibzee33 Shell Programming and Scripting 14 05-16-2010 03:44 AM
what is wrong with this script? rs1969 UNIX for Dummies Questions & Answers 2 11-15-2007 06:16 AM
What's wrong with this script amitg1980 Shell Programming and Scripting 3 11-12-2007 06:00 PM
what is wrong with this script? hankooknara Shell Programming and Scripting 8 06-09-2007 12:33 PM
something wrong with this script?? fusion76 Shell Programming and Scripting 2 02-01-2005 12:24 AM
What is wrong with this script? borncrazy Shell Programming and Scripting 5 07-20-2004 10:51 AM

All times are GMT -4. The time now is 09:39 PM.

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