Computing.Net > Forums > Unix > important question

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

important question

Reply to Message Icon

Name: mona
Date: March 30, 2006 at 04:33:38 Pacific
OS: unix
CPU/Ram: solaris 8
Product: sun solaris
Comment:

using this script, if the user enter ls -l
this error appear>>>> skinny.txt: test: unknown operator -l

how could i solve this problem


while true
do
printf "Skinny Shell > "

read command

if [ $command = quit ]
then
break
fi

x=0
for i in $*
do
if [ $i = $command ]
then
x=1
break
fi
done

if [ $x -eq 1 ]
then

./exec.txt $command

else
printf "Command not available\n"
fi
done

thanks in regard



Sponsored Link
Ads by Google

Response Number 1
Name: lchi2000g
Date: April 3, 2006 at 07:38:28 Pacific
Reply:

while true
do
printf "Skinny Shell > "

read command

if [ $command = quit ] <=== modify this line to if [ "$command" = quit ]

then
break
fi


Luke Chi


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: important question

important question..need help www.computing.net/answers/unix/important-questionneed-help/3303.html

couple of questions www.computing.net/answers/unix/couple-of-questions/2603.html

gunzip question www.computing.net/answers/unix/gunzip-question/7755.html