"what kind of shell are you using?" "unix"
"what kind of car are you driving?" "blue"
UNIX has many shells, "UNIX shell" tells us nothing.
Unix has many shells, but there is only one "Unix shell", i.e. the POSIX shell.
Quote:
Code:
function newrecord () {
The function definition syntax (a mishmash of ksh and POSIX) indicates that the shell is bash.
Quote:
Code:
clear
read -p "please enter a user number: " users2
If you're not using BASH, read -p won't work or won't do what you expect -- -p means read from a coprocess in ksh for instance, and other shells won't have it at all.
Another indication that he is using bash.
Quote:
Code:
output=$(grep "$users2" appraisalrecord)
What's in appraisalrecord?
Code:
output1=$(echo $users2 | tr -dc '[:digit:]')
This is to remove everything except digits I take it?
In bash (or ksh93), this can be done without an external command:
Code:
output1=${users2//[![:digit:]]/}
But a better way would be to use a case statement to determine whether there are any non-digit characters:
Code:
case $users2 in
*[![:digit:]]*) echo not number; ## do whatever
;;
*) ;; ## OK
esac
Quote:
Code:
if [[ $users2 = $output1 ]]; then
This will blow up whenever users2 or output1 are blank, put quotes around them.
Inside (non-standard) [[ ... ]], variables need not be quoted.
Im creating a sort of shell, for my cybercafe
This will restrict my clients from accessing unwanted materials
so im programming a similar bash to
1. to meet my goals
2. to learn new things.
im creating it in C,
please have a look at the attachement.
i wish to avoid having a blank space... (6 Replies)
i'm trying to learn unix and i posted a question and what i was typing from school. i can't figure it out. how am i supposed to learn , when i get shutdown by an admin. for posting a homework question. doesn't make any sense. its a dumb rule. thanks for helping (4 Replies)
Hi,
I am trying to attach tape drive to sun V890 running Solaris 9 on it.
I have installed HBA(qlogic) in slot 1 of 0-8 slots and booted the system. I do not see HBAin prtdiag output. The tape drive is not attached to HBA. The tape drive I am going to attach is Sony AIT3.
1.How can I make... (3 Replies)
Hi ,
I have already posted a post regarding this, but i didn't get my problem solve, so some body help me as it was urgent for me, my mail option is not working, when i send a mail, it is strucking in /var/spool/mqueue folder. and i am getting struck there itself, i see below two files are... (1 Reply)
Following is d code snipet
#!/bin/ksh
retVal=`sqlplus -s user/passwd\@oracle_sid <<EOF
SET SERVEROUTPUT ON SIZE 100000
DECLARE
STATUS_VALUE VARCHAR2(1);
BEGIN
SELECT temp1 INTO STATUS_VALUE FROM sai;
DBMS_OUTPUT.PUT_LINE(STATUS_VALUE);
END;
/
exit;
EOF`
echo "Return Value... (4 Replies)
I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being... (1 Reply)