I am currently try to learn the linux operating system as well as some bash programming. I have come across some online course work which has been very helpful, I have been working through some assignments and since I have no teacher to ask I have come to you experts.
So the program I am trying to write, asks the user to input a username and password. I have 3 combos that I came up with, and when a user gets them right you get a welcome. When you get it wrong I want it to loop for them to try again.
I can do this when it is just one variable, say enter password. But I am not sure how to do this when you have a username and password and you then want to verify against stored variables. Please excuse me if my english isnt the best at explaining.
Here is my code so far.
So I know that it is not correct, as any incorrect combo u enter wont let you try again to input ur choice. But I do not understand why? Could someone shed some light on this for me. I have looked at many resources and have not been able to answer.
Hi,
can someone explain how this aliases work:
alias m 'if ( \!:$ =~ *gz) set status = 1 && most \!:$ || gzcat \!:1 | most '
I mean, I know what it does, but I don't know how
- what is \!:$ and \!:1
- how do it used the && and ||
- what it does with status variable?
thanks (3 Replies)
So guys basically I was really sick and couldn't attend the labs and lectures and I went to my lecture hoping he would say ok I will help you from the start but he just said google it. So If it's possible to make the assignment and explain more in detail why is that would be really helpfull.
I can... (1 Reply)
Hi all,
I'm a fairly new beginner with shell programming and python programming. I have a mac (mountain lion OS 10.8.2) and use the terminal for programming. I'm trying to use the unix to easily organize some language data that I am working with. Basically I have to word lists, that I need to... (2 Replies)
Hi!
I have two shell scripts - Script1, Script2
Script1, Script2 - have return parameter
Script1 - is calling Script2
in Script2 I am calling program sqlldr - if this program is called then I did not get the return parameter from Script1
Do You have any idea how can I avoid this problem.
Mroki (6 Replies)
2- Write a bash shell script filestatic. The script should examine the number files in directories given as arguments (parameters) to this script.
a. if one argument is given, the script should count and report the number of files in this directory. Only regular files should be counted, not... (1 Reply)
In folder A i have a file "a' and text file named infile00.I would like to do redirection :a<infile01.
There is a code to do this
#get a file "a" in /home/A
for file in `ls /home/A`
do
if
then
#printing out if file is an execute file
echo $file "is an execute... (6 Replies)
Hi i would like to write a "script" which takes a directory as an argument and the script will output the content of a file in this directory.Here is my code
#!/bin/sh
#set an argument to be a specified path
$1=/home/tuan/Desktop/Shell_programming/directory
#check if an argument is a... (3 Replies)
1.if
2.then
3. # save the number of args and first argument in variables.
4. num_args=$#
5. id="$1"
6. echo "$id"
7. #echo "$1" > crapfile.txt
8. echo `sed 's/\*/'\*'/g' < crapfile.txt`
Above is a partial code.I would like to ask:
at line 1:... (1 Reply)
First, I'd like to know if being a shell programmer considered a "real" programmer. is it??
also, I do create a lot of shell programs which includes full scripts to create users and maintaining records. ie phone records.
now, I hear the programmer has to do some cleaning up after the... (3 Replies)