Welcome, Guest. Please Login
 
  HomeHelpSearchLogin FAQ Radified Ghost.Classic Ghost.New Bootable CD Blog  
 
Pages: 1 2 3 
Send Topic Print
Continued: Linux and Shell Scripting (Read 54470 times)
MrMagoo
Übermensch
*****
Offline


Resident Linux Guru

Posts: 1026
Phoenix, AZ (USA)


Back to top
Re: Continued: Linux and Shell Scripting
Reply #30 - Jul 14th, 2009 at 5:04am
 
You are coming up with good questions.

Rad.in.UbuntuVM wrote on Jul 14th, 2009 at 12:54am:
Isn't it simply a matter of launching the compiler, pointing it to/at the source code file and clicking the 'Compile' button?

Sure, compiling source into binary for one program isn't overly difficult.  The problem is that there are thousands (maybe hundreds of thousands) of smaller programs that make up the Linux OS.  RH packages them into a few dozen source tarballs.  What makes it complicated is that you have to compile them in the right order and put the resulting binaries in the correct places, and later ones depend on compiled versions of earlier ones. 

And, all this on a computer you are trying to install an OS to... so what are you using to do all this compiling and installing?  You have to have an OS of some sort somewhere to do all this downloading and compiling.

There is a 'distro' (I have to use that term loosely here) of Linux where you download original sources and compile them from scratch called Linux From Scratch:

http://www.linuxfromscratch.org/

Check out their install guide to get an idea of what's involved in a very basic install (containing no graphical environment and no frills):

http://www.linuxfromscratch.org/lfs/view/stable/chapter01/how.html

I've installed Gentoo before: http://www.gentoo.org/

The Gentoo install is not totally from scratch like LFS is, but does take you through some of the lower-level things that happen during an install.  It wasn't hard (with good documentation) but it did take about 4 days (with most of the last 3 days spent compiling.)  I learned a lot about some of the inner workings of Linux, but it isn't something I want to do regularly.  Even with the excellent documentation that the Gentoo project provides, I wouldn't have gotten through without already knowing Linux fundamentals. 

So, its not a matter of just hitting a button.
 
WWW  
IP Logged
 

MrMagoo
Übermensch
*****
Offline


Resident Linux Guru

Posts: 1026
Phoenix, AZ (USA)


Back to top
Re: Continued: Linux and Shell Scripting
Reply #31 - Jul 14th, 2009 at 5:08am
 
Rad.in.UbuntuVM wrote on Jul 14th, 2009 at 12:54am:
does the f option have to come last in a series of options for tar? 

No, but the name of the file that you want tar to operate on has to come immediately after the 'f', so it's easiest to put the 'f' as the last flag and then put the filename at the end.  For example:
  • tar -z -f somefile.tgz -x

should work, but its harder to type than
  • tar -zxf somefile.tgz
 
WWW  
IP Logged
 
MrMagoo
Übermensch
*****
Offline


Resident Linux Guru

Posts: 1026
Phoenix, AZ (USA)


Back to top
Re: Continued: Linux and Shell Scripting
Reply #32 - Jul 14th, 2009 at 5:16am
 
I think I'm going to change my tagline from "Linux Fanboy" to "Linux Guru."  I think I've earned it with this thread.

Edit:
From Wikipedia: In contemporary India and Indonesia, the word "guru" is widely used with the general meaning of "teacher"

I think I like it.
 
WWW  
IP Logged
 
Rad
Radministrator
*****
Offline


Sufferin' succotash

Posts: 4090
Newport Beach, California


Back to top
Re: Continued: Linux and Shell Scripting
Reply #33 - Jul 14th, 2009 at 9:44am
 
MrMagoo wrote on Jul 14th, 2009 at 5:04am:
So, its not a matter of just hitting a button.

10-4, roger that.  Smiley

Quote:
•tar -z -f somefile.tgz -x

here you have an option after the argument (file name). I thot options had to come BEFORE arguments, no?

Quote:
think I'm going to change my tagline from "Linux Fanboy" to "Linux Guru."

You've always been a Linux guru to me.  Smiley
 
WWW  
IP Logged
 
MrMagoo
Übermensch
*****
Offline


Resident Linux Guru

Posts: 1026
Phoenix, AZ (USA)


Back to top
Re: Continued: Linux and Shell Scripting
Reply #34 - Jul 14th, 2009 at 6:42pm
 
Rad wrote on Jul 14th, 2009 at 9:44am:
I thot options had to come BEFORE arguments, no?

You are correct.

Rad wrote on Jul 14th, 2009 at 9:44am:
here you have an option after the argument (file name).

The filename is not an argument.  It is part of the '-f filename' option.
 
WWW  
IP Logged
 
Spanky
Radmeister
**
Offline


Rad's non-Admin Test profile
in Seamonkey

Posts: 73
Same as Rad


Back to top
Re: Continued: Linux and Shell Scripting
Reply #35 - Jul 14th, 2009 at 6:45pm
 
MrMagoo wrote on Jul 14th, 2009 at 6:42pm:
The filename is not an argument.It is part of the '-f filename' option.

eyebrow-raiser.

that explains some other questions i had.
 
WWW  
IP Logged
 

Rad.in.UbuntuVM
Radmeister
**
Offline


Rad in Ubuntu 9.04 Jaunty
Virtual Machine

Posts: 92


Back to top
Re: Continued: Linux and Shell Scripting
Reply #36 - Jul 14th, 2009 at 9:06pm
 
Just to let you know, Wiredtree says the Rad VPS server is currently running CentOS 5.3

They *do* upgrade to each point release (5.1 .. 5.2 .. 5.3 .. etc) when cPanel says it's okay, so as to not break compatibility, cuz all VPS servers are based on cPanel/WHM.
 
WWW  
IP Logged
 
Rad.in.UbuntuVM
Radmeister
**
Offline


Rad in Ubuntu 9.04 Jaunty
Virtual Machine

Posts: 92


Back to top
Re: Continued: Linux and Shell Scripting
Reply #37 - Jul 19th, 2009 at 6:29pm
 
It would seem the 'chmod' command/program gets little use from the shell/command line due to programs such as WinSCP (SSH) that make using chmod so much .. easier. No?

Hmmm. I am trying to paste the URL for WinSCP from IE in Windows, but it's not working. Wonder why. Used to work fine. Weird.

How do I run a command as a super user in Ubuntu. Seems VMware Tools is not configured correctly. Sudo? What does "do" stand for? in sudo
 
WWW  
IP Logged
 
Rad.in.UbuntuVM
Radmeister
**
Offline


Rad in Ubuntu 9.04 Jaunty
Virtual Machine

Posts: 92


Back to top
Re: Continued: Linux and Shell Scripting
Reply #38 - Jul 19th, 2009 at 9:00pm
 
http://winscp.net/eng/index.php

haha! I *am* the man!  Cool

took quite some finagling to get that copy-n-paste to work.

ultimately had to reconfig vmware tools (said it wasn't config'ed properly/correctly), and then had to run "vmware-toolbox &" to start.

can you tell me why after the terminal says 'command not found' it does not retutn me to a prompt?

i get a new line, but not prompt.

had to close terminal window (ubuntu) and open a new one to get a prompt.

i think the previous vmware tools mighta been broken when i updated ubuntu.
 
WWW  
IP Logged
 
MrMagoo
Übermensch
*****
Offline


Resident Linux Guru

Posts: 1026
Phoenix, AZ (USA)


Back to top
Re: Continued: Linux and Shell Scripting
Reply #39 - Jul 19th, 2009 at 10:43pm
 
Rad.in.UbuntuVM wrote on Jul 19th, 2009 at 6:29pm:
It would seem the 'chmod' command/program gets little use from the shell/command line due to programs such as WinSCP (SSH) that make using chmod so much .. easier. No?

I use it from the command line - mostly after I finish with a script and want to make it executable or when I'm trying to adjust who can/can't get to the files on a central file server.

Rad.in.UbuntuVM wrote on Jul 19th, 2009 at 6:29pm:
How do I run a command as a super user in Ubuntu. Seems VMware Tools is not configured correctly. Sudo?

Yes, sudo.  Or login as the root user with "sudo su -" and then run your commands (if there are several of them.)
 
WWW  
IP Logged
 
MrMagoo
Übermensch
*****
Offline


Resident Linux Guru

Posts: 1026
Phoenix, AZ (USA)


Back to top
Re: Continued: Linux and Shell Scripting
Reply #40 - Jul 19th, 2009 at 10:46pm
 
Rad.in.UbuntuVM wrote on Jul 19th, 2009 at 9:00pm:
can you tell me why after the terminal says 'command not found' it does not retutn me to a prompt?

Do you get a prompt if you press enter?  What command did you run that it didn't find?  Did the command you tried have an "&" at the end?

Rad.in.UbuntuVM wrote on Jul 19th, 2009 at 9:00pm:
think the previous vmware tools mighta been broken when i updated ubuntu

Entirely possible, depending on how the vmware tools package was installed.
 
WWW  
IP Logged
 

Rad.in.UbuntuVM
Radmeister
**
Offline


Rad in Ubuntu 9.04 Jaunty
Virtual Machine

Posts: 92


Back to top
Re: Continued: Linux and Shell Scripting
Reply #41 - Jul 19th, 2009 at 11:32pm
 
yeah, had a & at the end.

tried enter, nada. seemed unresponsive to enter, iirc.
 
WWW  
IP Logged
 
Rad.in.UbuntuVM
Radmeister
**
Offline


Rad in Ubuntu 9.04 Jaunty
Virtual Machine

Posts: 92


Back to top
Re: Continued: Linux and Shell Scripting
Reply #42 - Jul 20th, 2009 at 12:23am
 
speaking of copy-n-paste ...

Quote:
Interesting trivia: the shell wildcards you asked about do have a special name, and they aren't regular expressions (as it happens the pattern characters it uses are chosen to be the same as those  used in regular expressions, but they aren't the same thing). Specifically, the UNIX shell wildcard expansion process has always been called globbing and the pattern language thus got called glob patterns or more informally just globs.

The WP entry on it at http://en.wikipedia.org/wiki/Glob_(programming) discusses this but doesn't quite get the etymology right. The name does derive from the name of a function, but that function was in the original Bourne Shell source code, which was written in a very early dialect of C during the mid-70's (it did eventually, much later, migrate to be available more generally but the name had already stuck by then). One of the aspects of the system at the time (the legendary PDP-11's) is that it was only a 16-bit machine, and so not only was C itself quite primitive at the time, to fit within the 64Kb memory constraints it was the habit of programmers to use short names for functions which generally were abbreviations or acronyms.

Although I don't recall Stephen Bourne saying this explicitly, it's reasonably clear what the source for the name is; mostly, the Bourne shell just processes individual strings, but the pattern-matching facility is unusual within the shell in that it generates multiple things as output. The name of the function reflected that this was what it did - it Generated a List of OBjects, and thus "glob" was a pretty natural choice of name for the pattern-expander function within the context of the Bourne Shell source.

[ It's also worth bearing in mind that at the time, the C compiler really did virtually *no* type-checking, so a function that output a list was quite a special thing. Naming it by what kind of data it returned was important because it was actually up to the programmer handling the return result to know that what came out of it needed to be treated quite carefully. This aspect of C got cleaned up eventually, and by about 1985 almost all C compilers were using decently strong type checking (and the ANSI standardization process had started to improve the language even further) but if you read the original 1970's source code it's more clear just how primitive the compiler was then and thus why most library functions were named the way they were). ]

So, the "glob" name really is more about the process of pattern expansion (turning one thing, the pattern, into multiple things) rather than denoting a particular pattern language or specific syntax, but the nature of language is such that "globbing" pretty much always refers to the particular style of wild-card pattern used by the Bourne Shell, which is much simpler and more direct than the regular expression system.

- Nigel
 
WWW  
IP Logged
 
MrMagoo
Übermensch
*****
Offline


Resident Linux Guru

Posts: 1026
Phoenix, AZ (USA)


Back to top
Re: Continued: Linux and Shell Scripting
Reply #43 - Jul 20th, 2009 at 2:38am
 
Rad.in.UbuntuVM wrote on Jul 19th, 2009 at 11:32pm:
yeah, had a & at the end.

The "&" at the end causes the command to be run in the background.  The thing is, it will still interact with your shell.  Error messages and output will still show up, for example.  It is common to not get a prompt after getting output for a command running in the background.  Usually, you can just hit enter and you'll get a new prompt.  Not sure what is going on in your case.  Probably an artifact of your VM.
 
WWW  
IP Logged
 
Pages: 1 2 3 
Send Topic Print