LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Closed Thread
  Search this Thread
Old 05-06-2003, 07:08 AM   #1
Tangerine
LQ Newbie
 
Registered: May 2003
Posts: 8

Rep: Reputation: 0
Pls Help!


hi everyone..

i am very new with bash shell scripting and i am having problems


#!/bin/sh
echo Please enter your username:
read input_name;
echo Please enter your password
read input_pass;
if ["$input_name" = "myname" -a "$input_pass" = "mypass" ]
then

echo user identified.
selection="1";
while [ $selection -ge 1 -a $selection -le 3 ]
do
clear
echo 1- List all html files with their contents
echo 2- List all files that contains a specified string
echo 3- End
echo
echo please select:
read selection
case $selection in
1)
echo The web pages in the current directory:
ls -l *.html
for file in *.html
do
cat $file
done
echo Press enter to continue
read;;
2)
echo Enter a specific string to search for in the files:
read String;
echo Press enter to continue
read;;
3)
echo Bye
exit;;
*)
echo Please choose a number between 1 and 3
selection="1";
echo Press enter to continue
read;;
esac
done

echo Unknown user.
fi


--------------------------

the error i am getting when i input is
>>>
Please enter your username:
myname
Please enter your password
mypass
./new: line 6: [myname: command not found

---------

HELP APPRECIATED PLS
 
Old 05-06-2003, 07:22 AM   #2
Tangerine
LQ Newbie
 
Registered: May 2003
Posts: 8

Original Poster
Rep: Reputation: 0
i found my stupid mistake

thanks
 
Old 05-06-2003, 07:24 AM   #3
Tangerine
LQ Newbie
 
Registered: May 2003
Posts: 8

Original Poster
Rep: Reputation: 0
i have this other question..

i want to print out the a file that has a specific string

any ideas?
 
Old 05-06-2003, 07:37 AM   #4
lokee
Member
 
Registered: Feb 2003
Distribution: Gentoo
Posts: 381

Rep: Reputation: 30
This kinda post should be in the 'Programming' forum.
 
Old 05-06-2003, 07:37 AM   #5
Tangerine
LQ Newbie
 
Registered: May 2003
Posts: 8

Original Poster
Rep: Reputation: 0
oh ok sorry new here
 
Old 05-06-2003, 08:41 AM   #6
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally posted by lokee
This kinda post should be in the 'Programming' forum.
Please leave this up to the Moderators to determine please in these situations. Since you didn't explain about double posting as well, he's gone off and posted this problem in programming, causing himself to double post which is against the rules. Next time I could have just moved it, but now I have to close this one.

Tangerine,

In the future, please use better and more helpful thread titles and next time if you post in the wrong forum, don't post it again please. A moderator can move threads and such.

Thanks.
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! Pls! Yull29m Linux - General 2 02-03-2005 12:57 PM
Can someone pls help me pancake Linux - Newbie 3 04-13-2004 12:22 AM
pls pls pls help me ! i'm tired with httpd config on fedora apache 2.0.48 AngelOfTheDamn Fedora 0 01-24-2004 05:12 PM
.pls Chazb Linux - Software 1 07-02-2003 07:49 PM
More C help pls The Bag Programming 6 03-11-2002 03:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration