- MCP server with stdio transport for local use - Search episodes, transcripts, hosts, and series - 4,511 episodes with metadata and transcripts - Data loader with in-memory JSON storage 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1857 lines
63 KiB
Plaintext
1857 lines
63 KiB
Plaintext
Episode: 183
|
|
Title: HPR0183: UCLUG Sepetember meeting
|
|
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr0183/hpr0183.mp3
|
|
Transcribed: 2025-10-07 13:13:04
|
|
|
|
---
|
|
|
|
music
|
|
Hello and welcome to the Upstate Carolina Linux user group podcast.
|
|
Thank you Lynn for that introduction.
|
|
Welcome to the Upstate Carolina Linux user group in South Carolina, in Zeeville, here we are at the media.
|
|
My name is Jayce, I will be doing the first presentation on shell scripting for newbies.
|
|
This is our last shell scripting for newbies.
|
|
Okay, so I'll just go ahead and get started.
|
|
I've got a handout which was yours on it to pass it by a handout if they want it.
|
|
That has all the scripts first night.
|
|
So last month if you remember, if you were here or have heard it on the podcast or whatever, I discussed four looping constructs in shell script bash specifically.
|
|
That is what's called a compound statement within bash.
|
|
It's one of many.
|
|
You've got four you've got it which I had discussed several months ago.
|
|
Tonight I'm going to discuss a wild construct, the case construct and the select construct.
|
|
I'm calling them constructs, I don't know if they're whatever.
|
|
The compound states, the states.
|
|
So it's never going to do wild.
|
|
I did a simple spitter call and I called the program wild spin.
|
|
So you see here at the very beginning, you've got the surveying mid bash indicating the bash can interpret the program.
|
|
And then I've got the next four lines is spinner square brackets 0, 1, 2, and 3.
|
|
And I'm going to assign them a different character.
|
|
In bash, you have arrays.
|
|
So you can have a variable that not only just holds a value, it can also have an array of variables.
|
|
And they have their own subscripts, the subscripts being in square brackets.
|
|
So you see right here, I've got the first spitter 0 to the dash.
|
|
Spitter 1 to the forward slash.
|
|
Spitter 2 sent to a vertical line and spinner 3 sent to a backslash.
|
|
Now I had to quote both the vertical line and the backslash.
|
|
Does anyone need to discuss why that is?
|
|
It's because they're special characters.
|
|
That's right, very good.
|
|
The vertical line is, as you know, you pipe the standard out of the left side to the standard end of the right side.
|
|
So we had to quote it.
|
|
And the backslash is a special character that escapes characters.
|
|
It's a quoting of the next character.
|
|
And so I'm going to quote it.
|
|
I'm going to quote the backslash.
|
|
I'm going to backslash the backslash.
|
|
I'm going to mean just the backslash character.
|
|
I could have also used single quotes, double quotes, something like that.
|
|
But I'm just giving you the multiple points.
|
|
And I'm probably good form would have said to do that with these other two, but this works.
|
|
And then I've got just this variable called n, setting it to zero.
|
|
Now I've got an echo dash n on the space.
|
|
Yes, sir.
|
|
What's the dash n going to do on that screen?
|
|
The dash n gives no new line.
|
|
So instead of doing, if I were to do it without the dash n, echo would just put a space and a new line character for character.
|
|
So let me just run this little program right quick.
|
|
And while spinner, you see here we got a little spinner.
|
|
I've probably seen this in downloading and that sort of thing.
|
|
It's just an animated little spinner.
|
|
And all it is, is it's just the minus sign, the forward slash, the vertical line,
|
|
or pipe character in the backslash.
|
|
And it's just going through the moment.
|
|
So here is why the way wild works.
|
|
It looks like it's compound statements.
|
|
You have wild, I can spell it right, wild, some demands,
|
|
do, some more commands, done.
|
|
And that is what the wild construct.
|
|
Now because this is on a different line you have to have,
|
|
if you're going to make, so there's the separator between the wild commands and the do.
|
|
So if you want to put it all on one line, you need to use a semicolon to do.
|
|
And, well, that's not important.
|
|
So anyway, so what it does is it tests this, or it finds out what the return value of this part is.
|
|
And I'll say wild commands, I'll just put it in the word command here.
|
|
So let's say command is some program that I've written, or it's a standard program.
|
|
So whatever the return value of the exit code of command is, as long as this is true,
|
|
then it will do the block, the do done block.
|
|
It will do everything in here, as long as command is true.
|
|
Now, again, going back to what we've discussed in the past,
|
|
the return value of command, in order for it to be true, it means that the return value is zero, meaning no error.
|
|
If there were an error, usually the logic of magic commands return at 1, 2, 7, or 15, or 16.
|
|
And they mean their own thing.
|
|
So.
|
|
Does that make sense to everybody?
|
|
Noobies?
|
|
Noobies at any time, those of you that are brand new and not been here.
|
|
This is the new session, so stop me at any time when you talk about anything.
|
|
Just because I've discussed it in the last couple months, I mean you know about it.
|
|
Or you've been here to block gas.
|
|
I'm famous.
|
|
So that can be any program, any command in your past date?
|
|
Sir.
|
|
You're saying that can be any command in your past date, right?
|
|
Because your ad is going to be looking for your path, if I'm using it.
|
|
It can be in the path of the program, if you send the path to just that program,
|
|
because your shield script is going to be run in its own environment.
|
|
It's going to be forked off.
|
|
Run over here.
|
|
That's what you could also put a full path.
|
|
That's what I mean.
|
|
If you want to do something.
|
|
Probably more often than not, you will use the test program, which I've discussed in the past.
|
|
What test does is it looks at some sort of equality or, you know, if the box is,
|
|
or that sort of thing, if you do a manual test, you can see what all that does.
|
|
So if you're going to use test, it would either be, instead of command,
|
|
you'd have test, and then, you know, 5 is equal to, you know, X or something like that.
|
|
So as long as X is equal to 5, it was, then test for return,
|
|
or have an exit code of 0, which is true.
|
|
So that's true.
|
|
That also, you know, I'm tested in its other form,
|
|
and probably what you'll more likely see is either the square brackets,
|
|
which will probably be the test in either band or user band,
|
|
or the double square brackets, which is the built-in test, which would be faster.
|
|
But, and the two tests have slightly different syntaxes.
|
|
More often than not, you'll see a wild test, something.
|
|
So when I say test, I mean, square bracket,
|
|
double square bracket, or the test program.
|
|
So lumping all those two, but it doesn't have to be the test program.
|
|
It can be any program.
|
|
It can be any combination of programs.
|
|
You can do a double ampersense to end a short circuit and all that sort of thing.
|
|
So, is that clear everybody?
|
|
Makes sense?
|
|
Okay, cool.
|
|
All right, so I got my spinner.
|
|
I'm going to control C, and that's, so now let me show you what I've done.
|
|
I've got the spinner running, so you can see what arrays are now.
|
|
I'm putting a space, and I'll explain why in a later.
|
|
Now, I'll explain why this is true, as you remember from two months ago,
|
|
is the true program has a return value of zero, which just is true.
|
|
The false program returns, you see the one or negative one.
|
|
I think it's one, which is correctly exiting false, right?
|
|
It's kind of confusing, but the false program purposefully doesn't work, right?
|
|
That's what you're expecting false to be false.
|
|
Okay, so now you see in here, we get in my, I do done the loop.
|
|
I've got setting in equals to dollar sign squared bracket in plus one squared bracket.
|
|
The dollar sign squared brackets is mathematical stuff within the back shelf.
|
|
So, I'm just setting in to in plus one, and I'm just incrementing in.
|
|
Then I'm setting in equals dollar sign for in for in for in.
|
|
The dollar sign for in for in for in is the same as the dollar sign brackets.
|
|
I don't know why there's just two forms of it.
|
|
Probably one was inherited from the orange side, the other was inherited from corn,
|
|
seed shell, so I don't really know.
|
|
But these two are both magnetic stuff.
|
|
This increments about one.
|
|
This does the modulus of four.
|
|
So whenever I get the value of four, I'm going to increment it.
|
|
I'm sorry, whenever it goes into the loop, it starts out zero.
|
|
And then I automatically increment to one, so it is now one.
|
|
Then it does one modulus four, which is one, and n is now one.
|
|
Then the next thing is echo dash EN.
|
|
And the dash EN, as we were talking about earlier, the EN tells it knocks it,
|
|
puts it carriage adjourned.
|
|
And the E is to, I don't know what it stands for, but it's four special escape characters.
|
|
That's probably what it is. It's a escape character.
|
|
So I've got a back slash B, which is a back space character.
|
|
So it's going to back space.
|
|
It's going to print.
|
|
And I've got those on.
|
|
Race and spinner.
|
|
Square brackets.
|
|
Dollars on EN.
|
|
Square bracket.
|
|
Race.
|
|
So EN, now we know, is one.
|
|
So spinner stuff, one, is forward slash.
|
|
And that's what it prints.
|
|
So it prints at the very beginning, it prints the space without a new line.
|
|
It backspaces over that space, which is why I had to put it at the beginning.
|
|
Backspaces over that space, and then it prints forward slash.
|
|
I've commented out the sleeve because otherwise it's very slow, choppy sort of thing.
|
|
Now I've just tried it one way or the other.
|
|
So sleep will just sleep for one second. That's what sleep does.
|
|
And then it comes back and goes back to the beginning and tests if the command part is true.
|
|
It's going to return true, so it's going to get back.
|
|
It's going to increment the end by one.
|
|
Make it N equal to two.
|
|
Modules of four is two.
|
|
Suspender two is going to be a vertical line.
|
|
That makes sense.
|
|
Then it's going to go.
|
|
You're going to do three backslushes.
|
|
Then it's going to go through four.
|
|
Now here's where the module comes in.
|
|
Four modules four is zero.
|
|
And then we get spinner zero.
|
|
Which is definitely the dash.
|
|
Why should you do the module as the status I get and this greater level of three and equal zero?
|
|
You could've done it that way.
|
|
You could've done it that way.
|
|
I felt like it.
|
|
You're a very module, right?
|
|
I wanted to show what module it was.
|
|
Exactly.
|
|
There's the man.
|
|
Yes, I want to show what module it was.
|
|
But yes, that's just going to go zero three.
|
|
Zero three, zero three.
|
|
Zero three.
|
|
And since I've got no way of exiting,
|
|
I had to control seeing the interrupt of the program to kill it.
|
|
Any questions on this program?
|
|
Yeah.
|
|
You can do sleep correction.
|
|
With the new sleep you can, yes.
|
|
If you use another sleep,
|
|
I think by tradition it's always been a whole second.
|
|
I may be mistaken on that.
|
|
And there's also a use sleep,
|
|
which does micro seconds.
|
|
Come on in, we should somewhere else.
|
|
Hey.
|
|
Morning.
|
|
Is there a reason why you didn't pound new colon while?
|
|
That's a colon, right?
|
|
Yeah, that was a comment to me to remind me to tell you,
|
|
this is new.
|
|
Wild is new.
|
|
Introducing these.
|
|
So you'll see that.
|
|
Arrays are brand new this month.
|
|
That's just for me.
|
|
Okay.
|
|
Now we've got our wild menu program.
|
|
So let me write it first so everybody knows what I'm talking about.
|
|
There we go.
|
|
All right.
|
|
So it says number one.
|
|
Check the email number two.
|
|
Surf the web.
|
|
Number three.
|
|
I have a file.
|
|
Number four spreadsheet.
|
|
Number five.
|
|
I'm going to say I want to surf the web.
|
|
Hey.
|
|
I lost firefox.
|
|
Okay.
|
|
Now I want to check my email.
|
|
Hey.
|
|
I lost much.
|
|
Let's do number four.
|
|
Hey.
|
|
Open up.
|
|
Sorry.
|
|
That's cool.
|
|
Number three.
|
|
Open up.
|
|
Again.
|
|
Hot dog.
|
|
Number five.
|
|
Thanks.
|
|
Great.
|
|
Fantastic.
|
|
Okay.
|
|
Pretty typical menu sort of thing.
|
|
You want to give this to first time users.
|
|
How do I edit a file?
|
|
Well, let's put it in open up.
|
|
All right.
|
|
So what I did.
|
|
In bash.
|
|
Create a function.
|
|
A bash function.
|
|
Call it menu.
|
|
We're in front of the end of menu.
|
|
It means that it's a function.
|
|
Put a brace.
|
|
Yeah.
|
|
But the brace isn't in a block.
|
|
And I'm just going to echo the choice that I put up on the screen.
|
|
So now I run the function that I just created called menu.
|
|
It's going to execute that.
|
|
Print this out.
|
|
And then it's going to go right to here.
|
|
Read dash p in an option.
|
|
Column bracket on dash five brackets.
|
|
Space quote.
|
|
And then a.
|
|
So what this does is while.
|
|
Has the argument.
|
|
Of the read part.
|
|
So the read program is what I'm running right now.
|
|
Before I do my two.
|
|
You remember from a couple months ago or last month I remember which.
|
|
What read does it.
|
|
Is it capture stuff from.
|
|
From the prompt.
|
|
So you type stuff in basically.
|
|
And if you give it a dash p option that's the prompt that will be prompted to the user.
|
|
So in an option of five space.
|
|
And then a in this case is the variable that I am putting what I respond to in.
|
|
So whenever I type one it's in the variable a.
|
|
Sir.
|
|
Sorry.
|
|
Is a.
|
|
Is read putting that into a.
|
|
Or is wild.
|
|
Read is putting that into a.
|
|
Because wild just expects.
|
|
Very serious.
|
|
Sorry.
|
|
Pump down.
|
|
Or something.
|
|
Right.
|
|
A list.
|
|
So.
|
|
Read's putting it into a.
|
|
So what you see here.
|
|
From before.
|
|
I got that.
|
|
Can you print this one through five.
|
|
You know that sort of thing.
|
|
And then I got the wall and read the inner option there printed right there.
|
|
And then I typed five.
|
|
So five is now put into the variable a.
|
|
Right.
|
|
Now it does the do since read returns true.
|
|
Because I actually type something in.
|
|
It's going to do the do what the do doesn't look.
|
|
Which is just big.
|
|
I just echoed a new line.
|
|
And here we've got.
|
|
A new compound statement.
|
|
The case.
|
|
Case is similar to.
|
|
C program.
|
|
C like programs.
|
|
Switch statement.
|
|
If you're familiar with that.
|
|
So what case is it.
|
|
You.
|
|
The form of case is.
|
|
Case.
|
|
The.
|
|
Variable.
|
|
Thanks.
|
|
Terrible.
|
|
I called us for my hand.
|
|
All right.
|
|
So case variable.
|
|
Don't have to be a variable.
|
|
But you probably don't want a variable.
|
|
You could put it on to there.
|
|
What would be important.
|
|
In.
|
|
A list of things.
|
|
And then.
|
|
So what is it?
|
|
I can never remember this.
|
|
And then.
|
|
Something.
|
|
Right.
|
|
We're in.
|
|
Statements.
|
|
Until you get a semicolon.
|
|
Cicolon.
|
|
And then you can have another.
|
|
Whatever.
|
|
Right.
|
|
For in.
|
|
More statements.
|
|
Cicolon.
|
|
Cicolon.
|
|
And then that'll be.
|
|
I see.
|
|
No way.
|
|
Case needs a.
|
|
Yeah.
|
|
That's it.
|
|
That's right.
|
|
And then it keeps going.
|
|
You can have as many.
|
|
First.
|
|
Right.
|
|
For in.
|
|
Until you have an e-sac.
|
|
Which is case still backwards.
|
|
Going back to.
|
|
If.
|
|
V.
|
|
Case.
|
|
E-sac.
|
|
All right.
|
|
So.
|
|
So this is the block.
|
|
All right.
|
|
So that's just the form of.
|
|
Now.
|
|
The way case works.
|
|
Is it inspects what the variable is?
|
|
Oh, let me.
|
|
Let me say another.
|
|
No, no, no.
|
|
Okay.
|
|
I'm sorry.
|
|
In part.
|
|
Please begin parts.
|
|
After end is where you put the.
|
|
What they.
|
|
It's what you want to test for.
|
|
I need to put.
|
|
I'm very eloquent.
|
|
And I, as you can see out.
|
|
I don't know why that is, but so.
|
|
Check the variable.
|
|
So.
|
|
In this case case.
|
|
B.
|
|
It'll check the variable.
|
|
A.
|
|
For whatever is in.
|
|
And whatever it finds it to be, whatever it answers to be, it'll jump to that right side for end statements.
|
|
Okay? Does that make sense, everybody?
|
|
So, whenever I type one for check email, it goes to this line right here, one right for end.
|
|
It'll echo a month. So, you saw whenever I've been to check email, it's time for work buttons for you.
|
|
It didn't actually execute it, but it, you know, told me what it's going to do, because if I actually did it then it would be a much longer presentation.
|
|
And when I type the number two to search the web, it went here, and you see I've got two vertical line FF.
|
|
And what does that mean? So, this next option right here can take either a two or an FF as my answer to an option.
|
|
So, whenever I run this program again, I could type FF, and it runs Firefox.
|
|
If I type two, it runs Firefox, right? So, it did, in both cases A resulted to be, in the first case A resulted to be FF, so jump right here.
|
|
In the next case it resulted to be two, so then same thing jumped to the same place.
|
|
So, you can have multiple values for a certain little subline.
|
|
Then I've also got one, if I can find one, I'm going to type the work one instead of the number one.
|
|
It would do a different email program by IG. So, I type the work one.
|
|
So, when I type the numerals one, it ran, but when I type the work one, it ran Gmail.
|
|
That's a hidden option because I didn't print it out, right?
|
|
Excuse me.
|
|
All right. So, I need the fact that I'm screened for me.
|
|
Okay. Now, I've got one, and I've explained one, two, and FF are.
|
|
Now, you see, you're probably good form would say you want to have them quoted.
|
|
And here again, it's a string match. It's not a numeral match. It's a string match.
|
|
So, it's matching the string three, or it's matching the string character four.
|
|
The string that's done perfect four.
|
|
If I were to type the V, it would have executed or printed out the word them, because that's my editor.
|
|
And, you know, for the first time, usually I'm going to tell them to use that in office. For me, I'm going to use them.
|
|
Then I've also got, okay, so let me do the next option here.
|
|
You know, I didn't invent it right, but that's called my editor at work.
|
|
It replaces tab characters with four spaces.
|
|
So, I tabbed out and got spaces instead of them.
|
|
Tab characters, like the first time I edited it for some reason.
|
|
So, anyway, so right here, I've got some string in this here.
|
|
This is using the normal wild card globbing.
|
|
I'm going to call it by this because some people know it.
|
|
Some people know it as globbing. Some people know it as wild carding.
|
|
It's technically globbing, but it's wild carding.
|
|
Does anyone not know wild carding or globbing is?
|
|
Add on the command line? What is globbing?
|
|
Globing is what it used to be called.
|
|
Now, it's still called. It's just the name of it. It's a glob.
|
|
So, it's going to do J-star, or J-star.
|
|
Or star rock star, or four question marks.
|
|
So, if it's the command line, I'd type in a J-strocks.
|
|
Hey, yes, J-strocks, but anyway.
|
|
So, I did what this little subblock, you know what I typed?
|
|
J-strocks, because it matches J-strocks.
|
|
It will also match the capital J.
|
|
Whatever.
|
|
Yes, J-strocks, but anyway.
|
|
Okay, so that's what that was.
|
|
Then, let's say,
|
|
Mozilla rocks hard.
|
|
Yes, J-strocks, but anyway.
|
|
So, that's the response that I get.
|
|
And that's because of the glob.
|
|
I got star rocks star.
|
|
Okay.
|
|
It's just making sense to everybody.
|
|
So, you jump to here because when it runs, I didn't.
|
|
Mozilla rocks hard.
|
|
That matches the star rock star.
|
|
That makes sense.
|
|
So, in glob and wildcarding,
|
|
the star has any number of characters with any sort.
|
|
Now, if I do four random characters,
|
|
that's what matches the question mark.
|
|
The question mark means one character.
|
|
So, I've got four question marks up there.
|
|
That's where this matches.
|
|
This is H-J-K-L.
|
|
Matches four question marks, right?
|
|
So, any four letter word would match J-strocks.
|
|
But anyway.
|
|
Next, the last option of God.
|
|
Well, I'll go to the last option.
|
|
Because you probably, from good form,
|
|
you're going to want to have your default.
|
|
So, any character that view the star
|
|
or the question mark doesn't match?
|
|
In this particular case, no.
|
|
Because it's going to put the whole thing into A
|
|
as a string in singular double quotes.
|
|
What have you want to think about it?
|
|
It's the whole string of something.
|
|
In that case, it's going to match spaces.
|
|
It's going to match new lines.
|
|
It's going to match.
|
|
Well, what match new lines?
|
|
Because read.
|
|
It puts it into the new line.
|
|
So, if I put some sort of strange option
|
|
that doesn't exist up there,
|
|
I think it's with the J-strocks.
|
|
It starts with the J.
|
|
Yeah, okay.
|
|
There we go.
|
|
Dry dry.
|
|
How about that?
|
|
That's a good point.
|
|
Dry dry.
|
|
I just start.
|
|
Which is anything, right?
|
|
It starts anything.
|
|
It's similar in concept to the C-like programming
|
|
when you just get a default with a switch thing.
|
|
So, a good form says that at the very end of your case,
|
|
statement, you want to have a default.
|
|
Because if someone types the wrong thing,
|
|
you want to do something.
|
|
Whether it's reported error,
|
|
no, that's not right.
|
|
It runs the menu again or whatever.
|
|
So, in my case, I'm just going to exit
|
|
and exit feels the program only going.
|
|
So, it comes out of the exit.
|
|
Now, here I've got a sitting-go-quoted star, right?
|
|
And what that'll do is it'll echo the word exit.
|
|
So, if I run this program again
|
|
and I type the character star,
|
|
it's going to go to that case.
|
|
Is that too complex to make sense?
|
|
Which is different than whatever.
|
|
Just something to be aware of.
|
|
You're not going to see it in most places,
|
|
but just be aware of it.
|
|
Any questions on this part?
|
|
Everybody understand the case now?
|
|
I don't know what that is.
|
|
Anybody have any questions?
|
|
Cricket? Cricket? Cricket?
|
|
Okay.
|
|
Oh, so at the end of the case,
|
|
statement, then I do a new line,
|
|
and then I can bring them on the menu,
|
|
go back to the reprompt,
|
|
and then check.
|
|
So, that makes sense to the loop,
|
|
the outer loop.
|
|
Okay, so I did the same thing,
|
|
or similar thing,
|
|
with menu two, while menu two.
|
|
I've got these six options.
|
|
Mud, Gmail, Firefox, open office,
|
|
VIM, and exit.
|
|
So, if I type that number
|
|
to the corresponding program,
|
|
three for Firefox, let's say,
|
|
it's executing Firefox, right?
|
|
And then let's say mud,
|
|
number one, Gmail for number two,
|
|
whatever, and for VIM,
|
|
I'll need to disprach in open office.
|
|
Okay, so that's enough of that.
|
|
Let's exit.
|
|
Okay.
|
|
So, this is a similar idea
|
|
to the menu program I just did,
|
|
but we'll different.
|
|
So, what I did here,
|
|
what's used the select,
|
|
compound statement.
|
|
So, I've got here,
|
|
like I'm going to hit myself,
|
|
a similar program using select.
|
|
Okay.
|
|
So, P is three,
|
|
I'll explain that in a second.
|
|
All right, so, but this time,
|
|
instead of using a while true,
|
|
I decided to use the until,
|
|
compound statement.
|
|
Until is the almost exactly the same,
|
|
as while, with exception,
|
|
that it's backwards.
|
|
So, until,
|
|
we'll keep running until the,
|
|
so the form of the until is,
|
|
until commands,
|
|
do done,
|
|
do block done, right?
|
|
Until is waiting for the,
|
|
the negative,
|
|
return value to V0
|
|
before it goes to queries.
|
|
That doesn't make sense.
|
|
Okay, so,
|
|
while this is true,
|
|
do blah, blah, blah, blah,
|
|
blah,
|
|
on the converse,
|
|
until this is true,
|
|
blah, blah, blah, blah, blah, blah.
|
|
Okay?
|
|
So,
|
|
whereas I would have written this
|
|
with a while true,
|
|
until not true, right?
|
|
I could have said until false,
|
|
but the exclamation point,
|
|
that's why I did this,
|
|
exclamation point,
|
|
I'm a command line,
|
|
before a command,
|
|
indicates not of that,
|
|
the opposite.
|
|
It returns any,
|
|
any, or,
|
|
exit value that is 0
|
|
gets returned as 1,
|
|
any non-zero,
|
|
return value gets,
|
|
becomes 0 when you put the,
|
|
exclamation point in front of it.
|
|
I hate not.
|
|
Questions on that?
|
|
Now, okay.
|
|
So, I've got an until loop,
|
|
and here's what I do,
|
|
done blah.
|
|
So, I've got the select program.
|
|
Here's the,
|
|
here's the other compound statement,
|
|
that we're talking about tonight.
|
|
Select,
|
|
and a variable,
|
|
in a list,
|
|
do, block,
|
|
done.
|
|
Very simple,
|
|
and you can use this variable
|
|
inside here,
|
|
you want to be sure you use
|
|
the dollar sign variable.
|
|
This,
|
|
you don't want to have the dollar sign in front of it.
|
|
If you exclude the in list,
|
|
it assumes,
|
|
dollar sign 1,
|
|
dollar sign 2, dollar sign 3,
|
|
blah, blah, blah, blah.
|
|
The command argument is
|
|
that you get to that program.
|
|
Does that make sense?
|
|
Or that one?
|
|
Any questions on that?
|
|
Okay.
|
|
So,
|
|
so what's select will do,
|
|
as you saw.
|
|
I've got a list,
|
|
so in my program,
|
|
I've got select,
|
|
proggy,
|
|
or proggy,
|
|
and program name.
|
|
There's some variable called proggy,
|
|
in,
|
|
and then I've got a list,
|
|
much gmail Firefox,
|
|
open office,
|
|
vim,
|
|
exit,
|
|
just to list the words,
|
|
just a space,
|
|
limited set of words.
|
|
And then, so what select does,
|
|
as you remember,
|
|
here,
|
|
is in formatted,
|
|
and really nicely said,
|
|
the first item,
|
|
number one,
|
|
grin,
|
|
is that.
|
|
So in this case,
|
|
one grin month,
|
|
then it went down,
|
|
and then,
|
|
second one,
|
|
two,
|
|
grin gmail,
|
|
three,
|
|
grin Firefox,
|
|
four, grin off,
|
|
open office,
|
|
five,
|
|
vim,
|
|
exit, right?
|
|
It makes sense.
|
|
Select just does it for you.
|
|
It's just beautiful.
|
|
Now, when you type in another,
|
|
okay, here's the,
|
|
here's the reason I've got the PS3,
|
|
on the shell,
|
|
you've got,
|
|
you're a,
|
|
PS stands for
|
|
prompt.
|
|
Help me out on somebody,
|
|
anybody?
|
|
See, PS,
|
|
I don't know what PS stands for,
|
|
but it's your prompts.
|
|
Your PS1,
|
|
pumpkin,
|
|
PlayStation 3,
|
|
prompt sign,
|
|
prompt sign.
|
|
I think that's what it is,
|
|
prompt sign.
|
|
Yes.
|
|
You can think of it as prompt sign,
|
|
even if it's not.
|
|
So,
|
|
so right here,
|
|
you see my prompt,
|
|
before I didn't like it,
|
|
I didn't like it,
|
|
I didn't like it,
|
|
I didn't like it,
|
|
I didn't like it,
|
|
before I ran the program earlier,
|
|
I've got user1 and
|
|
susatop,
|
|
colon,
|
|
print,
|
|
slide,
|
|
or totally slash,
|
|
pry-wild,
|
|
greater than space.
|
|
That is my prompt on my computer.
|
|
So,
|
|
PS1 is defined to be
|
|
user,
|
|
which is,
|
|
I think,
|
|
by any way.
|
|
It's user-hat,
|
|
post-name,
|
|
colon,
|
|
directory,
|
|
greater than space.
|
|
That's my prompt.
|
|
I'll show you that.
|
|
I echo,
|
|
L-S-M-P-S-1.
|
|
No, no, no,
|
|
PS1.
|
|
You see here, I've got,
|
|
backslash-U,
|
|
username,
|
|
which is,
|
|
user1,
|
|
and,
|
|
that's backslash-H,
|
|
post-name,
|
|
colon,
|
|
backslash-U,
|
|
I like you.
|
|
Now,
|
|
that's W-W,
|
|
we're working directory, I think,
|
|
greater than space.
|
|
That's just,
|
|
PS1 is your prompt at the command line.
|
|
You've got PS2,
|
|
which will prompt you
|
|
for continuation.
|
|
So, if I didn't echo,
|
|
quote,
|
|
something,
|
|
and then,
|
|
I'm going to see,
|
|
anyways,
|
|
for continuation.
|
|
And then PS3 is another one.
|
|
PS3 is used specifically by Select.
|
|
So,
|
|
this is the prompt
|
|
that's selected for you.
|
|
So,
|
|
you saw up here,
|
|
whenever I typed in,
|
|
or whenever I ran the program,
|
|
Select.
|
|
Formatted as much,
|
|
e-mail,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
fire,
|
|
got put into Pragy, and then that Pragy part, this is where I probably would have used
|
|
a case like that, but this time I decided to choose to use the true test program and test
|
|
for Pragy. If test for Pragy is the word exit, the next, and then I'm going to execute
|
|
it. Otherwise, because exit will kill the program, otherwise it's going to end up executing
|
|
and then what the value of Pragy not enough. I could have run back for it. Now you need
|
|
to break after whatever, because otherwise select will just keep spinning. I guess you
|
|
will prompt the person before you type one of these questions. Even if you type in the
|
|
right number, the one you just want is just going to keep passing. And so you break out
|
|
after you select. Okay, select, make sense everybody. What's up? Can I talk to that?
|
|
Well, already got more. No. We started late. All right, I'll sit back up. And this is the
|
|
final batch shell scripting, so it's going to run a little over anyway. Okay, do you want
|
|
to give announcements now or something? No, I'll wait till you back. Are you sure? Yeah.
|
|
Okay, I just got one more anyway. I got a question on this last one. Go ahead. So what
|
|
do you have until we go around it? When I say select does a loop, I mean, it's until
|
|
it will re-ask until you give it an answer that if you understand. So if I type JK, well,
|
|
I don't know, I've only used like just a little bit, but whenever I have a brand's program
|
|
before, and I just had to select, it wasn't working, it wasn't looping, it wasn't going back
|
|
and ask, that's what it is. It asks you one time. In order for it to ask again, it will prompt you
|
|
and say you give it the right answer or something like that. But in order for me to run this program,
|
|
I'll run over and over and over again. I had to have the auto while. So if you have a select,
|
|
it'll just put the menu up and do it. Right? And that's where I would have used it, maybe
|
|
it used a case or something like that, or in the program. And then continue on down for
|
|
further or whatever. So I'm just, I want to do this over and over again, infinitely.
|
|
Is that, does that make more sense? Oh, and that's another thing I'm going to tell you.
|
|
Select, it's different from the other program in that instead of putting into
|
|
variable what I typed in, it puts into this variable what is in this list. So when I typed
|
|
into, it put it, it put the string gmail into Pragy. Right? It didn't put it to in Pragy.
|
|
It put the string that two represents. Right? So that's another major difference you need
|
|
to understand about that. So if I do my case statements, I want to put cases around
|
|
much gmail Firefox, not one, two, three, four. I like it did before. Right?
|
|
So now it's the last one. Read stats. Okay.
|
|
Should I run the program first? All right. So here I've got a little file called stats.
|
|
And it's just, just a file created with some random numbers, numbers facing up, numbers facing up,
|
|
numbers facing up, just like that. Some sort of statistics that I've got whenever I
|
|
am writing that whatever. So when I run the while stats per, read stats per, read stats,
|
|
while read stats per, here's my output. It takes the first number,
|
|
the principle, put the x, second number, and then does product, so these are the products.
|
|
Two times 78 is 156. Two times 98,000 is 196 now. So that's my products.
|
|
Then I've got my remavers. 23 mod 8 78, which is that 23 mod 8 78 23.
|
|
243 mod 3 and 0. So that's this one. Then we've got this error right here.
|
|
But I'll explain that later. Pay no attention to the man behind the curtain, right?
|
|
All right. So in this program I've got two wireless.
|
|
The reason I wanted to show you this program is that you will, you will see a lot of this, this sort of thing.
|
|
What I'm doing first of all is I've got this, I showed you the stats from the file, right?
|
|
I'm redirecting the stats, not redirecting the stats program, into the sort program,
|
|
sorting numerically, which is what the dashin does. So it sorts this file numerically.
|
|
So all the ones will be first, the two will be second, the three will be third, the 23s, then the 243s in the front yard.
|
|
Right? Does that make sense? That's numerically. Otherwise, if I didn't give it the dashin,
|
|
you would do an alpha numerically by character. So you would see two, 20, and then we go to 3, 30, 40.
|
|
So I do a sort of stats and hiphate into the while read AB.
|
|
So read is A and D as it's variables. So what it's going to do is it's going to take the sorted stat list.
|
|
And the first stat is put in A, the second is put in B.
|
|
Right? And I've got this to do done.
|
|
Echo, dashin A, X, dashin B equals, dashin square bracket A, star B.
|
|
So it's going to multiplication, substitution. A times B is the product of A and B.
|
|
It prints out two times one equals two, for example.
|
|
And that keeps looping until read returns false, which is at the end of the file.
|
|
So as long as they're standard input, being put into read, it's going to continue.
|
|
It's going to read it, print it out something.
|
|
So you see up here, the product, two times one equals two, two times seven.
|
|
Right? Does that make sense to your butt?
|
|
Pretty simple, right?
|
|
Then I've got my remainders, some redirecting.
|
|
This time of redirecting, direct leads are reading.
|
|
While reading C and D do, echo, dashin C mod, the word mod, dashin D equals,
|
|
and then I've got the dashin square bracket again, C percent D, which is the modulus operation.
|
|
C modulus C, D. So right here we've got, and this time I'm not, I'm going to,
|
|
and then I've got the done, a less than and then stats.
|
|
So this time, you've got stats being redirected into done,
|
|
which really gets redirected into the due while.
|
|
So it's sort of, looks to read, right?
|
|
So read, so the stats file, it's opened up, set as standard in to the read program,
|
|
and then each one gets A, and it's put into C and D.
|
|
Does that make sense?
|
|
Any questions on the data?
|
|
No? And then you see our vision about zero error, well that makes sense.
|
|
Somewhere in here I've got A, zero errors.
|
|
There you have your point to mod zero.
|
|
That doesn't make sense, because you've got to mod by zero.
|
|
You've got infinity, you've got a black hole, right?
|
|
So that's where it chokes, and the program just dies right on this line,
|
|
and doesn't process the first step.
|
|
So you need to be aware of, I would get the same thing if I would have done instead of a modulus,
|
|
by the force line.
|
|
Any questions on anything?
|
|
This is the final batch-shelter-cripting session.
|
|
Any questions?
|
|
Is there a way to do like error handling or something like the mod zero?
|
|
Yeah, what I would want to do, but ahead of time, is to check if E is zero.
|
|
Actually I would probably just do dots and B, empty and empty.
|
|
Right?
|
|
No, I do it.
|
|
Huh?
|
|
No, I would do it if...
|
|
If the test zero equals D, or the other round, you want to, then do the echo.
|
|
When you say error handling, or you say handle something one and error does occur,
|
|
or catch an error before it occurs.
|
|
Because if you want to catch the error after it occurs, you could just test on dollar questions,
|
|
and that will give you the return code of the last thing executed.
|
|
Dollar question mark will give you the return code of the last state of execution.
|
|
That was another thing I wanted to point out.
|
|
Yes, thank you for saying that, because if I run this program again,
|
|
and then I echo...
|
|
See, I got to divide by zero error.
|
|
If I do an echo of dollar sign question mark, one, which means false, right?
|
|
So the return value of my last program was false, and that's because I got to divide by zero error.
|
|
Now, inside of run this again, I get a zero.
|
|
Anybody know why?
|
|
Is that code?
|
|
Because echo correctly.
|
|
It was good.
|
|
I think it really did, or echo return file.
|
|
So the dollar sign question mark is the return value of the last thing that happened.
|
|
Now, if you've got a block, you've got whatever, it's going to be the last block.
|
|
So if I were to check, dollar sign zero is the result of the read.
|
|
If I did a dollar sign right up here before the done, it would have been the return by echo.
|
|
Which would have been the net, the one.
|
|
It gets passed up to the calling function and the calling program.
|
|
And that's part of it.
|
|
Okay, does that make sense?
|
|
No more shell scripting for Nubis.
|
|
Is it correct me for any of these users now?
|
|
No, I'm done for a little bit.
|
|
All right.
|
|
There are a number of faces I don't recognize.
|
|
How about we go around the room and introduce ourselves.
|
|
I'll start.
|
|
Okay, now I'm a person who kicks the speakers off and interrupts them.
|
|
And I have a couple other announcements, but we'll move on to it.
|
|
Cheers.
|
|
No, no, bye.
|
|
Good.
|
|
I'm done.
|
|
Good.
|
|
Are you introducing yourself?
|
|
Oh, you're talking about interventions.
|
|
Yeah.
|
|
Oh, got you.
|
|
Chair, it's up.
|
|
I'm the network engineer at the worthwhile company.
|
|
Do what posting and design?
|
|
All right.
|
|
That's who I am.
|
|
My name.
|
|
Yates.
|
|
Yates.
|
|
You might know him from the bottlenecks lights podcast.
|
|
For nine.
|
|
I don't think he's got a lot of literature.
|
|
Oh, I'm a vitamin formulated.
|
|
A real job, though, James.
|
|
Yes, yeah.
|
|
I'm formulaic vitamins.
|
|
Awesome.
|
|
Thank you.
|
|
It's a podcast.
|
|
He's got, I think the last one that I've heard figures on was 6,000 people listening.
|
|
Close.
|
|
To me, that's very impressive.
|
|
What's more impressive is that he lives like five miles from my house, and I didn't realize it until about three or four months ago.
|
|
Anyway, go ahead, John.
|
|
We'll go pick him up later.
|
|
Hi, I'm John Yeary.
|
|
I work for Ag to help share the senior enterprise architect here.
|
|
I design internal business systems primarily in Java, and I'm the president of the local Java users group.
|
|
Yes, sir.
|
|
I'm quite interested.
|
|
I'm right-crowned for our small software company.
|
|
Jeremy Sands.
|
|
I'm director of IT operations and study group.
|
|
That's quite great.
|
|
CS, senior, good, good city.
|
|
Go host the source gas podcast.
|
|
And I'm the director of awesome.
|
|
Oh, I wonder when that is.
|
|
You're worth a lot of money.
|
|
Very good.
|
|
What I say, it's engineering the sales department.
|
|
When we're here, I didn't know.
|
|
I didn't want to happen.
|
|
There were a little bit of that.
|
|
Can you go right in the eye, anything?
|
|
Well, there's some basically the IT department at the moment.
|
|
Well, I'm Carl Gerranger.
|
|
I'm Laura Kerr.
|
|
I actually used to work in this building.
|
|
I did with the equipment for a free.
|
|
Really?
|
|
And this is my hobby.
|
|
That makes me just up here.
|
|
I'm a first officer.
|
|
That's production.
|
|
Fine.
|
|
So.
|
|
It's great to find some services.
|
|
I'm doing business.
|
|
Learning it.
|
|
Great to find.
|
|
Crack mother.
|
|
Have a long day.
|
|
Well, try to learn how to end it up here.
|
|
Stir trouble.
|
|
Yeah.
|
|
I'm doing good tonight.
|
|
Good night, Sean.
|
|
My major, I've worked at Bosch in Anderson.
|
|
I'm an engineer down there.
|
|
I'm a main factory engineer back.
|
|
I'll just do what I'm doing because it's cool.
|
|
I made Alfred signs on the Solares admin and customer support.
|
|
I'll take a question.
|
|
Hey, I'm Kevin Jones.
|
|
Voice Dan Allen.
|
|
It's been 10 tornado.
|
|
Next, obviously.
|
|
Great to see you.
|
|
I currently have a flooded moment.
|
|
I used to work at the airport for a major airline.
|
|
I was doing a restructuring.
|
|
And I've been used to be in Windows for a while time.
|
|
And now I'll start learning Linux.
|
|
I'll just sing it more and more.
|
|
I'm trying to crop it up to somebody with an appliance.
|
|
Now I'm not going to learn it.
|
|
Great.
|
|
Do you know what I'm doing?
|
|
I work at a computer security team.
|
|
On the what?
|
|
A computer security team.
|
|
I thought you said that.
|
|
A computer.
|
|
A computer.
|
|
Yeah.
|
|
Yeah.
|
|
I kind of missed that.
|
|
I was like, there's no balls secure.
|
|
Who was this at?
|
|
I don't know.
|
|
It's a cell.
|
|
It's a brain code.
|
|
So what's your map lock?
|
|
What's new to security?
|
|
That means we don't do security.
|
|
We actually do anything.
|
|
But we call it security.
|
|
We are being recorded.
|
|
And that block is.
|
|
Thank you.
|
|
Right.
|
|
Go ahead.
|
|
I know I'm going to be a little bit more.
|
|
And I just started learning Linux about a year ago,
|
|
after I've just got a single Windows.
|
|
Who is it?
|
|
Well, it's a good block.
|
|
And I lost a few years under the night.
|
|
Hey, I'm not like your favorite baby family.
|
|
Yeah.
|
|
I was on the show with you.
|
|
Right then.
|
|
I'm now his arm.
|
|
I was in Congress.
|
|
A year and a director.
|
|
And then I'll make it.
|
|
Thank you.
|
|
Thank you.
|
|
Thank you.
|
|
Big computer.
|
|
Did you eat the computer?
|
|
Did you eat the computer?
|
|
Yeah, you did.
|
|
You're good.
|
|
I'm just kidding.
|
|
And I'm Chase.
|
|
I'm Chase Eckert.
|
|
I did the vast shield scripting.
|
|
Thank you.
|
|
I'm a legs programmer at Conrad Corporation.
|
|
We are guys that actually write a little storage manager.
|
|
They will resale for stuff.
|
|
What's your name again, Jake?
|
|
Jayce.
|
|
What is everyone calling you?
|
|
Probably Jayce.
|
|
Sometimes I get to laugh, actually.
|
|
Sometimes I get to laugh when you actually do it.
|
|
And we don't have to calm down.
|
|
Okay.
|
|
Hi, my name is Jayce.
|
|
I could buy it.
|
|
Jayce.
|
|
It's not good.
|
|
It's short for just something.
|
|
Just another something.
|
|
Well, it's the PLA.
|
|
All right.
|
|
I've got a couple of announcements.
|
|
Director Jared Blues.
|
|
A couple of things happen.
|
|
Jared, you didn't know your employee.
|
|
I'm sorry.
|
|
Jared.
|
|
What's your name?
|
|
My name is David Allen.
|
|
I'm the person who interrupts people.
|
|
So, these lines best.
|
|
We have a date, which we didn't have last month.
|
|
We have a venue, which we didn't have last month.
|
|
And we have a board, which we didn't have last month.
|
|
And there's a ton of work to be able to do work.
|
|
People have wants to be the secretary.
|
|
Sorry.
|
|
That position, I mean, could be open-minded.
|
|
But we meet Tuesday, 9 o'clock, and I actually thought
|
|
these lines best on IRC.pre-day.net.
|
|
If you need help getting on to IRC, someone around here
|
|
can help you.
|
|
The date is June 13th, and it's going to be in Clemson.
|
|
And we're going to need lots and lots of help,
|
|
particularly for people in the United States.
|
|
We live here, here.
|
|
In the form of guidelines.
|
|
We're going to need people who can,
|
|
who can man the registration booth.
|
|
We're going to need people who can operate a...
|
|
People that help vendors.
|
|
People that help vendors.
|
|
And where they're going, help them move stuff in.
|
|
Because we've got to, at the moment,
|
|
a very short set-up window.
|
|
We've got a number of things going on.
|
|
I think we approved the event's going to be free.
|
|
With an option that you pay 50 bucks,
|
|
and you'll be declared a supporter or a sell.
|
|
And we'll be a teacher or a minor question to a party.
|
|
If you're cool enough.
|
|
Yeah, there is a minimum requirement.
|
|
We've got 50 dollars in that amount.
|
|
And that's cool without bias.
|
|
And we may have some one incident here,
|
|
which is just what it says,
|
|
that if you'll help us, we might consider bias that.
|
|
But that has been decided on,
|
|
so that's my thought and got the boards.
|
|
Go ahead.
|
|
And how we are talking to Clemson about sponsoring some costs for it.
|
|
Clemson's logic is actually sponsoring the location.
|
|
And they're even about $2,000 of costs that we would have otherwise paid.
|
|
And anywhere else it would have cost us four or six thousand bucks just to get the venue.
|
|
For our first year, we're going to put up with something that's probably not ideal
|
|
for the next position standpoint,
|
|
but it is a can handle a good number of people.
|
|
Before I get into the website,
|
|
so for free today, September 20th.
|
|
Kevin is running that.
|
|
I handle some swag.
|
|
Two in.
|
|
That's going to be at the library.
|
|
So come, come some people who will install Linux.
|
|
Get used to Linux.
|
|
Is that the name of that?
|
|
That is downtown.
|
|
It's down to 100.
|
|
And so anyone who's listening to Dave Gates podcast,
|
|
that's near Greenville, September 20th.
|
|
I believe you're starting at 10 o'clock.
|
|
Yes.
|
|
10 a.m.
|
|
Till 3 p.m.
|
|
If you want news, what's your email address?
|
|
freelance PC at gmail.com.
|
|
And so you just heard his email address.
|
|
And I'm sure that Dave Gates will put something in his show notes
|
|
to point to the poster.
|
|
Do we have show notes?
|
|
There are show notes every person.
|
|
Is there?
|
|
Yes.
|
|
The script's in there.
|
|
Yeah.
|
|
That's the last question.
|
|
Jeremy, can we put some directions to this place on the website whenever you are?
|
|
Let's not get on the website.
|
|
Yes.
|
|
We'll talk about that.
|
|
Charles is having a Linux demonstration day, a pretty software demonstration day,
|
|
September 14th at the Muddy Waters coffee shop.
|
|
That is, I think it's 10 to 4.
|
|
I'm going to be wrong about the time.
|
|
You can see it at csclug.org.
|
|
So if you're in the Charleston area, you should get to that.
|
|
And a couple of us are going to go down and try and bid their ears.
|
|
The website.
|
|
Media on gave us a virtual machine on their VM cluster.
|
|
And we're thankful.
|
|
And they're giving it to us practice.
|
|
Technically, I'm on the hook for the site.
|
|
I'm happy to grant pseudo access given the following requirements being met.
|
|
That you provide me with a mobile phone number that I can send text messages to,
|
|
because you'll be out in nine years alerts if you have pseudo access.
|
|
An email address that you convince me that you're at least somewhat competent to operate Linux.
|
|
Or that you can fool me.
|
|
If you can fool me, that works.
|
|
I'm in.
|
|
And first-born child.
|
|
Don't care about her.
|
|
I don't want to.
|
|
There are a lot of responsibility.
|
|
My wife would complain of having another child.
|
|
Let's put it that way.
|
|
You don't want to force her.
|
|
Right?
|
|
Yeah.
|
|
So that's different.
|
|
I am the child right now.
|
|
I don't need competition.
|
|
So anyway, the media is going to do it.
|
|
And whoever picks up and runs with whatever they want can do whatever they want.
|
|
It's part of platform, database, et cetera.
|
|
But we need to make a mention that immediately.
|
|
It's a publicly provided link.
|
|
And let's say that you got to be willing to accept my text messages and emails from not years.
|
|
Yes.
|
|
It's a website like this now.
|
|
So those are all requirements that are pretty easy.
|
|
Or.
|
|
And.
|
|
So what we're going to do now is if you want to.
|
|
Have a pseudo access.
|
|
Go ahead.
|
|
Don't we have a new address to.
|
|
It will be.
|
|
Hopefully tonight.
|
|
Give you a brief history.
|
|
Our website went down a couple months ago.
|
|
Thought it used to work at a service provider.
|
|
And consulting place.
|
|
And the box went down.
|
|
And I don't know the details of it.
|
|
But having something that only one person can get.
|
|
Two is a bad idea.
|
|
We're going to try to eliminate some of that single point failure.
|
|
By having multiple people who essentially have pretty level access.
|
|
And then making them responsible.
|
|
So they start getting the way they three.
|
|
And they've got.
|
|
Dual triple.
|
|
It doesn't.
|
|
These here.
|
|
We should have a bandwidth or.
|
|
Connection issue.
|
|
So if you want.
|
|
That level of responsibility.
|
|
You can come see me and I'll get you.
|
|
That level of access.
|
|
And we're going to let Jared talk.
|
|
And hopefully.
|
|
We can hack out.
|
|
At least the beginnings of a side.
|
|
Up time the meetings over.
|
|
Or not a class.
|
|
Which ever comes first.
|
|
And after Jared's done.
|
|
I'll tell you the two minute.
|
|
Way to.
|
|
So he asked with us.
|
|
He likes.
|
|
All right.
|
|
I said poor.
|
|
My name is Jared.
|
|
I work for the world company.
|
|
There was some discussion on the list.
|
|
This past week about what exactly a kiosk is.
|
|
And.
|
|
At least from my standpoint,
|
|
there's.
|
|
There's multiple definitions.
|
|
And it really depends on what you're talking about.
|
|
Interactive kiosk or.
|
|
Or just something that displays information.
|
|
And.
|
|
I've worked with both.
|
|
At different jobs and things that I was doing.
|
|
And.
|
|
This past week.
|
|
My boss asked me to design a.
|
|
A kiosk type.
|
|
Set up that.
|
|
Basically just displays presentation in our lobby area.
|
|
On a big LCD screen.
|
|
And.
|
|
So I.
|
|
I decided to go with a thin install just on a really compact.
|
|
Shuttle machine.
|
|
That we built for pretty cheap.
|
|
And.
|
|
I.
|
|
I really decided there was no use spending, you know,
|
|
however much 40, 50 bucks on a hard drive when.
|
|
We've got a VM server with plenty of this space.
|
|
And it would be really cool if you could just boot right over the network.
|
|
Into a.
|
|
Into.
|
|
Some of us that stored somewhere else in the network.
|
|
And.
|
|
So I started searching around.
|
|
And.
|
|
At first I was thinking just to a plain pixie boot with.
|
|
NFS, which I had done.
|
|
With something else before.
|
|
And then I came across this project called jeep pixie.
|
|
And.
|
|
I'm not sure if you guys are aware of what pixie is.
|
|
Basically it's just a.
|
|
A boot rom that.
|
|
You can.
|
|
You're.
|
|
You're basically grabbing information from your DHCP server.
|
|
And using that information to.
|
|
Bootstrap something on your machine.
|
|
And pixie is very limited by itself.
|
|
I believe it was.
|
|
Written by Intel originally.
|
|
I could be wrong on that.
|
|
But I see their name all over copyrights all over it.
|
|
But it's very limited as to what it can do.
|
|
It can basically grab something from a TFTP server.
|
|
And.
|
|
Showed in the memory that's bad all that I know of that it can do.
|
|
The great thing about it is that jeep pixie.
|
|
Is basically something that you can bootstrap.
|
|
From pixie.
|
|
And so you can shove it on.
|
|
So you shove your.
|
|
Jeep pixie image onto a TFTP server.
|
|
And then that gives you a more expanded set of options.
|
|
As to what you can.
|
|
Boot off of.
|
|
Your network.
|
|
And it can connect to.
|
|
HTTP.
|
|
FTP.
|
|
TFTP.
|
|
And the big ones here that I'm focused on are.
|
|
Our.
|
|
GTA.
|
|
Over ethernet.
|
|
AOE.
|
|
And ice.
|
|
And ice guzzies.
|
|
The thing I'm really using.
|
|
I experiment a little with AOE, but it was just.
|
|
It was something not something I really.
|
|
To get my.
|
|
My head around.
|
|
But really.
|
|
Ice guzzies.
|
|
Any of you that.
|
|
Enter.
|
|
Or into server administration.
|
|
Might be aware of ice guzzie.
|
|
And it basically presents.
|
|
Some disc.
|
|
It could be either a disc image.
|
|
Or a physical disc.
|
|
Or a partition.
|
|
Or whatever you want.
|
|
It presents that as.
|
|
As a scusy device to the machines connecting to the ice guzzie
|
|
server.
|
|
And so.
|
|
You can.
|
|
You can connect to the ice guzzie server and say.
|
|
I want to use that disc.
|
|
And.
|
|
All of a sudden.
|
|
On your Linux box.
|
|
Or Windows box.
|
|
If you want to use Windows.
|
|
It shows up as another scusy device in your system.
|
|
It's pretty transparent to.
|
|
To the.
|
|
To the user.
|
|
Land.
|
|
So you can run out of disk.
|
|
And you can.
|
|
You know, repartition the disc or do whatever you want.
|
|
It really looks like a physical disk.
|
|
And what G.Pixie allows you to do.
|
|
Your bootstrapping for pixie.
|
|
And the G.Pixie.
|
|
And then you can.
|
|
You can connect to an ice guzzie server using G.Pixie.
|
|
And boot right off.
|
|
So.
|
|
What I did here was.
|
|
I set up on.
|
|
On our physical network.
|
|
It worked.
|
|
I set up a.
|
|
Our.
|
|
Our.
|
|
Our D.H.C.P.
|
|
Server.
|
|
We're using DNS mask.
|
|
I'm looking.
|
|
I've heard of that.
|
|
It's a combination.
|
|
D.H.C.P.
|
|
DNS.
|
|
And TFTP server.
|
|
And I set that up to basically just hand out the information.
|
|
For bootstrapping that the G.Pixie ROM image.
|
|
To the clients.
|
|
And so it boosts G.Pixie.
|
|
And it also passes a little parameter telling it.
|
|
We're to find the ice guzzie disk that it's going to boot.
|
|
And.
|
|
Give me just one second here.
|
|
I can pull up.
|
|
That could be filed.
|
|
Right here.
|
|
And I'm on.
|
|
This is just a.
|
|
A.
|
|
A.
|
|
B.M.
|
|
I'm running here.
|
|
I can install with basically everything turned off.
|
|
And DNS mask installed and configured here.
|
|
Basically, it's just not.
|
|
It's listening on this address right here.
|
|
And it's passing.
|
|
It's listening on the zero interface.
|
|
It's passing some D.H.C.P options.
|
|
And this defines what range it's going to end up.
|
|
It dresses with.
|
|
And.
|
|
I'm turning on the TFTP server as you notice there.
|
|
And telling you where to find the TFTP redirectory.
|
|
And.
|
|
The D.H.C.P.Match there is basically.
|
|
It's saying.
|
|
It's going to pass.
|
|
And it's actually an option that your.
|
|
Pixie client is going to pass back if it tries to boot again.
|
|
If G.Pixie's for some reason.
|
|
For some reason we're to time out.
|
|
It exits the G.Pixie ROM and then tries to.
|
|
Keep on pixie booting something.
|
|
And so it goes back to the server and says, hey, I do something.
|
|
And this is going to keep it from getting G.Pixie again.
|
|
And just, you know, looping around.
|
|
And so it.
|
|
It sends this guy to the pixie client.
|
|
And that's going to send it back to the server whenever it tries to boot again.
|
|
And this line here is saying it's not that option.
|
|
Then send it this.
|
|
And.
|
|
This is the parameter that is sending.
|
|
It's telling it.
|
|
What is going to use.
|
|
All right.
|
|
And that's pretty much all that's all that's on the DHCP and DNS and TFTP side.
|
|
That's all DNS masks.
|
|
It's pretty small.
|
|
You can run on your WRT router if you really want to.
|
|
All right.
|
|
And as far as ice goes, he's concerned.
|
|
Let me pull that up real quick.
|
|
Close my mouth.
|
|
All right.
|
|
Really, there's only two lines here.
|
|
To the ice goes configuration.
|
|
You just define your target name.
|
|
They have some weird conventions as to what you're supposed to call the ice-busy targets.
|
|
And I pull something on via that.
|
|
I have to.
|
|
I really don't think it really matters.
|
|
You can name it if you want.
|
|
But just in the same sitting face.
|
|
I may have something to do with someone cryptic official.
|
|
All right.
|
|
But you basically specify your target name.
|
|
And then select here.
|
|
This is just a plain old.
|
|
You know, a virtual disk that I attached to the VM.
|
|
And I'm telling you, it's just going to access it like a regular block device.
|
|
And pass it right over the network.
|
|
And that's all there is to the ice-busy configuration.
|
|
On that image now, I end up.
|
|
I mounted on my system.
|
|
And I use dev bootstraps to do a basic.
|
|
The boots are already installed on the on the disk image.
|
|
And then installed grub and all sorts of wonderful things to make it bootable.
|
|
All right.
|
|
And that's all there was to that.
|
|
And then the last thing was simply.
|
|
You know, I created another VM that has, you know, no disks at all attached to it.
|
|
And all it has is the first boot device is the network interface that I have.
|
|
And it's pointing.
|
|
As you can see here, you picked up the, let me reset that real quick, as you can see.
|
|
As you can see, it's grabbing the IP address from the DHC server right here.
|
|
And.
|
|
It's trying to gravity a IP address of the DHC server.
|
|
You can do it.
|
|
All right.
|
|
We're just going to try power up real quick on this and turn it back on.
|
|
There we go.
|
|
And as you can see, it loaded GPC right here.
|
|
And.
|
|
And it loaded the ice as you target.
|
|
And it's booting throughout right now.
|
|
And at this point, it's basically grabbing the initial grand disk.
|
|
It's accessing it just like it was a local hard disk.
|
|
And there was just a little bit of finagling with, with having the kernel.
|
|
The, the kernel has to load the ice as you drive it to so that it can actually see the disk.
|
|
And so do you have to read?
|
|
No.
|
|
The only thing I had to do was modify a few files with the init RAMFS configuration,
|
|
and then, and then regenerate my initial rend disk.
|
|
And there's actually some houses out there on that.
|
|
Now, this is actually the same image that I'm using at my workplace.
|
|
I just, you know, do you need to copy all of it?
|
|
And it runs a little promotional video that one of our marketing people made up.
|
|
And that's Cody Webster or mascot.
|
|
So anyway.
|
|
So that's just about all there is to it.
|
|
And I know that really was a lot of steps, but it's actually not that hard.
|
|
I think I said this up and about an hour and a half.
|
|
And most of that was fighting with virtual boxes, internal networking that tends to not work.
|
|
And sometimes work other times.
|
|
But as far as getting it to work on the physical network, it worked almost instantaneously once I understood the concepts.
|
|
And there were some changes that I had, I had to hack out some of the scripts that you had to throw into the initial rend disk to make the work right.
|
|
And the scripts that they had on one of the house whose I was falling was completely screwed up.
|
|
And I had to, I had to hack them together myself.
|
|
So I'm probably going to just go ahead and write another how to and post it out there.
|
|
Just for anyone else to have the same thing.
|
|
And really the point is that you can have a, you know, with, with enough, you know, existing network infrastructure.
|
|
You can have a thin client installation out there with just some disk image on a server somewhere running open-eye scusy, which is great.
|
|
And you can have a motherboard CPU and probably just integrated, integrated video on the motherboard.
|
|
That's all our box has just an Intel chipset.
|
|
And you can have a thin client installed right there that you just plug in and go.
|
|
No hard drive, no optical drive, nothing.
|
|
And that's all I got.
|
|
Are you using a new version of virtual box?
|
|
Yes, I just pulled that last night in fact.
|
|
It's probably why I was having so many problems.
|
|
All right, I had a, I went searching for this because I've seen a nice how to, how to use SE Linux to do a kiosk.
|
|
And by kiosk I mean something that's going to wipe every single time to do something.
|
|
So think a public internet cafe that allows you to come use a computer for a specified amount of time.
|
|
Or, you know, one of the community centers that the pretty Linux PC projects thinking about setting up for places like seniors unlimited.
|
|
You know, you have these people who are in their 60s and 70s.
|
|
Going sitting down in a machine, the last thing you want to do is have them try and go to their bank account and do someone else's account.
|
|
Or try and go to Gmail and do someone else's email.
|
|
And that's right with all kinds of privacy.
|
|
So what you're looking for is you're looking for a desktop, maybe even a limited desktop, that you can allow people to log into it, clean the stuff up.
|
|
Because you're not going to want to create a user for every single person in the internet cafe or a community center.
|
|
They may be there one time or they may be there all the time.
|
|
So I found the document that had about 20 or 30 steps on how to figure out these things to essentially wipe all of that data as soon as the person logged out.
|
|
And to limit what they can do pretty severely.
|
|
And then I realized that, oh yeah, this person thought I was such a good idea, they made a package out of it.
|
|
So the way that you set this up, if you're using Cento's rail or the door, is yum install ex-guest.
|
|
And you do have to have SEO links set to enforcing.
|
|
It can't be permissive or disabled because it won't allow you to log in then.
|
|
But then it comes up when GDM comes up, it comes up with an option for guest.
|
|
You click on guest and log in without password.
|
|
It gives you access to a predefined set of programs which you can modify the security, the SEO links, model and policy.
|
|
So you change what they have access to.
|
|
But the default is to essentially give them what any appropriate which user would have.
|
|
They can go in, they can create work files, they can write them to flash, they can write them to the temp file system that they want that it goes away.
|
|
They can serve the web just like any other user could.
|
|
As long as they don't need read low access, it will do anything they want.
|
|
It does not allow them to shell in, it only allows connections via GDM.
|
|
And it's 34K, that seems like it's policy.
|
|
So I was going to get up here and say, there are these 20 steps, I'm going to get through them.
|
|
But as long as you don't mind using a red habit based operating system, you can have a console, a kiosk set up with single command.
|
|
And that's it. And that made it very easy on me.
|
|
So what is it, how do you determine what is not programs they can't account for?
|
|
You would use security labels.
|
|
So you would allow people with ex-guests to execute things like Firefox.
|
|
But not allow them to execute other things.
|
|
Is that an NC Linux thing?
|
|
Yeah.
|
|
It's what file labels are.
|
|
It's also called contents.
|
|
And now you probably also want to do the, I mean, you probably also want to do what you need to do.
|
|
But they're seeing essentially what's ever in his scalability.
|
|
So how do you figure that out?
|
|
What's it going to see?
|
|
Each time it lays?
|
|
What's the command?
|
|
So it creates a new guest user?
|
|
Yeah.
|
|
Yes, it does create a new guest user.
|
|
So the guest user can only log in via the user.
|
|
Y'all can install ex-guests.
|
|
Anything else I can answer?
|
|
Yes.
|
|
Let me try to make sure I understand it.
|
|
This is started into a new data plan.
|
|
Now, this isn't towards using thin clients.
|
|
This is, for instance, Kevin's working on getting three or four computers set up at the senior center.
|
|
They have about 15 people who are going to come in and use them.
|
|
And essentially, we don't want one person seeing what the other person was doing.
|
|
But we also don't want to create 15 accounts on each machine.
|
|
Or have to deal with setting up a LDAP server or anything of that nature.
|
|
Because we don't want to maintain that.
|
|
We don't want them to go in.
|
|
They can use the computer when they leave.
|
|
It's just as it was when they came in.
|
|
Can you set the permissions different for the guest user from?
|
|
Yes.
|
|
For what?
|
|
This guest user can handle this provision.
|
|
And this one can.
|
|
There is only one guest user because they can log in without password.
|
|
If you really wanted that level of different permissions,
|
|
you'd probably create a user and the assignment in password.
|
|
But this is designed to essentially wipe away anything that they do.
|
|
And since you can't control who has access to it, if they get to the keyboard,
|
|
there's just not going to point it.
|
|
So this does not use that one, or anything like that.
|
|
It's purely.
|
|
It's purely.
|
|
That's also a valid intent file system.
|
|
They get like a 180 ntm file system that just goes away.
|
|
Who do you use that one?
|
|
I don't know.
|
|
I don't know enough about that part.
|
|
What was that of any user besides context files?
|
|
Label.
|
|
Label.
|
|
It's not a, it is files have an additional attribute of context for labeling.
|
|
And it's specifies who can access it.
|
|
And how they can access it.
|
|
It's not a new feature, but it's always in COVID.
|
|
It is always been called that messy lines.
|
|
Is that a file system level attribute?
|
|
Yes.
|
|
Because there's a Chican, which changes context.
|
|
OK.
|
|
And restore it.
|
|
A few other.
|
|
And if you do, I think it's LS-Z.
|
|
You'll see the context.
|
|
See the dash-Z.
|
|
If you have messy lines, turn them on.
|
|
If you want to see this, I set it up on my laptop.
|
|
About five minutes.
|
|
So I'll show you.
|
|
Please.
|
|
I see Linux is a mandatory access control.
|
|
Essentially, the NSA said they did not.
|
|
They were not getting fine-grained enough permissions with Unix ACLs.
|
|
So they developed a layer on top of that called mandatory access controls,
|
|
which in addition to what you have at, what you can re-river, execute,
|
|
you also have to have a label that says you can do that.
|
|
Part of the thought is that, you know, if Apache gets compromised,
|
|
Apache should not be touching other files.
|
|
So even if you have something running as root,
|
|
if it's that process, it should never do anything except what's expected of it.
|
|
Do you see it on this dash-Z?
|
|
Apple Z.
|
|
Absolutely.
|
|
I think it's CapsA yet.
|
|
See if I get it to take them out to change resolution.
|
|
It's going to be OK.
|
|
Oh, it's here for a second.
|
|
There it is.
|
|
All right.
|
|
So come in as guest.
|
|
And so you get access to my one gig SD card to write stuff to you.
|
|
And so we'll go out here and we'll, could you say that to you like a partition,
|
|
or can you say, you know, RAM is?
|
|
Well, currently, what is, currently the home directory is stored on a tent file system,
|
|
which is how X gets to set up.
|
|
And, but it sees anything that's plugged into the machine.
|
|
So if I plug USB into it, it would see the USB drive.
|
|
And right now there's a one gig SD card.
|
|
OK.
|
|
So the SD card, the one gig is not the home directory.
|
|
Right.
|
|
No, it just happened to be in the machine.
|
|
And just like you have somebody, tell them to write to a, you tell them to write to a flash drive or something like that.
|
|
Would it see a mounting file system?
|
|
I'm sorry.
|
|
Would you say it?
|
|
Would it see a mounting file system?
|
|
May I remote?
|
|
Share or something?
|
|
If the user had rights to do that.
|
|
But I don't think the user does unless it's something like FTP or maybe SFTP.
|
|
So you can write stuff to flash or SD or whatever.
|
|
Whatever it's going to mount without needing readable permissions.
|
|
Flogging.
|
|
I don't know if floppy's out of mount.
|
|
So let's come over here and we will create something on the desktop.
|
|
By the way, I'm running an encrypted, fully encrypted disk.
|
|
Everything takes forever on my tie a little two and a half inch drive.
|
|
Are you encrypted?
|
|
Well, except for the slightly, it's not encrypted.
|
|
Let's swap and everything else is.
|
|
Where's the key in my head?
|
|
Okay.
|
|
I don't know if you can get it on the SD card or something.
|
|
No, I can add like 15 different keys.
|
|
I could do that.
|
|
But I don't.
|
|
All right.
|
|
So we saved an office document.
|
|
There.
|
|
If we log out.
|
|
I can come back in just by clicking.
|
|
Take your word for it.
|
|
Well, it'll work.
|
|
It comes up with nothing there except for what's in the skeleton profile.
|
|
And that's not bad for setting up a POS.
|
|
How do you restrict which application data access?
|
|
You would, that's a little more intensive.
|
|
You'd have to change the, you do one of two things.
|
|
You'd either hide the files from the disability stripping by changing what they see and the skeleton profile.
|
|
Or you would, you changed the context and that's the limits so they could not execute the trial orbit.
|
|
You should have a little breaker.
|
|
Let's see if I can.
|
|
That's not a console.
|
|
What is a terminal?
|
|
I know.
|
|
No, actually right now they have access to anything that a non-privileged user would have access to.
|
|
What am I missing?
|
|
It's all under a connection.
|
|
What do you remember?
|
|
The skeleton profile.
|
|
Pretty easy to support and easy to follow through.
|
|
Usually they just compensate.
|
|
Whatever's in the center still into the home director?
|
|
Yeah.
|
|
That's it.
|
|
That's it.
|
|
Yeah.
|
|
Because there's your dot number.
|
|
You don't have all your profile stuff in it.
|
|
But.
|
|
Yeah.
|
|
But I don't see, I see nothing there.
|
|
Well, it could be pulling up the coldness.
|
|
Yeah, it may be.
|
|
You might have to define that out.
|
|
What do you remember?
|
|
Everyone can agree.
|
|
PW.
|
|
PW.
|
|
But.
|
|
See, we're home ex-guests.
|
|
Home ex-guests time.
|
|
It has created a temp file system.
|
|
It's the same time you're known.
|
|
I'm missing something somewhere here.
|
|
But.
|
|
I don't know if it's here or not.
|
|
Is it under administration?
|
|
Well, I mean, it's got the bind option there.
|
|
That's it.
|
|
That's like probably in the folder.
|
|
Yeah.
|
|
But why is it?
|
|
Why would it have the same thing for both?
|
|
I don't know.
|
|
That's weird.
|
|
That is weird.
|
|
If you want to read how this works,
|
|
I mean, Dan Walsh wrote up a nice tutorial on how to do this,
|
|
or there was a 40-package all of this into a packaging.
|
|
Yeah, you can't carry your brush or anything with you.
|
|
And you might as well let that work.
|
|
Yeah, you can't carry your brush or anything with you.
|
|
And you might as well let that work.
|
|
And he asked.
|
|
All right.
|
|
He asked.
|
|
He wrote up a very nice article at,
|
|
and you've put this in the shipment state.
|
|
Dan Walsh.5journal.com.
|
|
It's like 13376.
|
|
And let's see.
|
|
What am I missing?
|
|
This section here, I think, is how it's mounting.
|
|
I'm going to type FFs on ex-guess home.
|
|
Let me see what's that.
|
|
Tell me ex-guess.
|
|
Yes.
|
|
To answer your question, there are things like browser.
|
|
If you want it to only run the browser,
|
|
you can do things like browser to find ex-guess,
|
|
which is a predefined policy for where it is.
|
|
I can't run it because it's management.
|
|
But it will, it will confine them to doing nothing
|
|
with the browser.
|
|
If you want them to do it for sites other than local sites,
|
|
are you running on that particular box?
|
|
You have to allow them to write data from Firefox, et cetera.
|
|
So you can get it narrowed down pretty well.
|
|
Now these have been predefined.
|
|
These two boards that are going to see this have been predefined.
|
|
And make that a little easier.
|
|
If you just want to give them net access,
|
|
not an office or something.
|
|
Anything else I can answer?
|
|
All right.
|
|
It is 8.13.
|
|
Are we going to need to give James yet?
|
|
Yes.
|
|
All right.
|
|
So we need to be there before 9.
|
|
Thank you.
|
|
Thank you.
|