Radified Community Forums
http://radified.com/cgi-bin/yabb2/YaBB.pl
Rad Community Technical Discussion Boards (Computer Hardware + PC Software) >> PC Hardware + Software (except Cloning programs) >> UNIX Shell scripting
http://radified.com/cgi-bin/yabb2/YaBB.pl?num=1244785343

Message started by Rad on Jun 12th, 2009 at 12:42am

Title: UNIX Shell scripting
Post by Rad on Jun 12th, 2009 at 12:42am
Regarding UNIX Shell scripting, I read the following statement, but don't understand exactly what it means. Can any UNIX/Linux studs clarify?


Quote:
The Bourne and C-shell families are completely incompatible from a programming standpoint, and they differ in their implementations of other certain features (such as command history), but otherwise they can be used interchangably.

What can be used interchangably? Shell scripts? I don't see how these two shell families can be "completely incompatibly," but "used interchangably."

I think what it's saying is that the two families of shells behave similarly when used on an interactive basis to start other programs, then they behave similarly. But scriots written for one (programming standpoint) will not work in the other. Yes?

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 12th, 2009 at 5:29am
I'd need more context to understand the statement.  Can you provide a link?

My guess would be that they are compatible in that you can use either one on almost any Linux system.  Both are compatible with the kernel in the same ways.  In fact, you can have both installed next to each other and switch between them at any time.  What you can't do is write a script in one and expect it to run well in the other.  The format and behavior of the commands are different in important ways.

I'm not sure where you ran across this information or what you are reading up on, but I'd stick to the Bourne Again Shell (BASH).  Bash comes installed as the default shell for every distribution of Linux I know of and many BSD distributions.  The only system I can think of off the top of my head that doesn't come with Bash as default is Solaris, which I think uses csh (C shell), and even then BASH is installed as an option. 

Besides, almost anything you can do in a different shell can be done just as easily in a program written in Perl or Ruby or C, which can then be called by a bash script.  Bash is the only shell I use, and it has never stopped me from doing anything the way I wanted to do it.

I'm not saying the other shells don't have their place.  People who live in the command line can move around with amazing speed using the right shortcuts in the right shell.  I'm just saying that for anyone whose world extends past a shell prompt, your time is best served by learning BASH and then moving on to other tech skills like programing languages.

Title: Re: UNIX Shell scripting
Post by Rad on Jun 12th, 2009 at 9:10am

MrMagoo wrote on Jun 12th, 2009 at 5:29am:
Can you provide a link?

video tutorial

http://www.vtc.com/products/Unix-Shell-Fundamentals-tutorials.htm

see link titled "which shell"

Title: Re: UNIX Shell scripting
Post by Rad on Jun 12th, 2009 at 2:17pm
as a little extra info, i ran across this:

http://www.amazon.com/Wicked-Cool-Shell-Scripts-Taylor/dp/1593270127/

.. to a book titled "wicked cool shell scripts", where one of the reviewers says:


Quote:
I also don't think there is anything "wicked cool" about shell scripting in general: if you need anything complex at all, Perl or something else is probably a much better way to to it. Shell scripting gets awfully nasty awfully fast.

However, I was wrong. Yes, shell scripting is an abominable way to approach most of the tasks this book explores. Just the same, the author does it "wicked cool" and you can learn a lot both from how he sees the problem and the other Unix tools he uses as part of the script.

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 12th, 2009 at 4:35pm
I couldn't get the video to come up.

As far as the book goes, I definitely agree with most of the reviewers that any shell script more than about 15 lines can probably be done better in Perl or something else.  On the other hand, if you learn shell scripting, you'd be learning both shell and getting your feet wet in basic programing at the same time, so it might be good for  you.

My only concern about that book is that it might not provide enough of an explanation about what is going on for you to easily follow.  See this comment in the reviews:


Quote:
Taylor does some neat stuff with shell scripts, but he doesn't spend much time explaining what goes on in them. Each is accompanied by a terse paragraph explaining "how it works", which generally only addresses one particular aspect of the script (ie, POSIX-style "variable slicing"). Shell syntax is terse and many of the reserved keywords and functions are not self-evident. If you don't know, for example, what "${#remainder}" returns, Taylor won't help you; you will have to look it up in a tutorial or a reference work elsewhere.


At a minimum, I think you'd have to supplement this book with some shell scripting tutorials on the web.

Title: Re: UNIX Shell scripting
Post by Rad on Jun 12th, 2009 at 5:37pm

MrMagoo wrote on Jun 12th, 2009 at 4:35pm:
I think you'd have to supplement this book with some shell scripting tutorials on the web. 

Like this?

http://www.vtc.com/products/Unix-Shell-Scripting-Advanced-tutorials.htm

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 12th, 2009 at 6:43pm
That's pretty basic stuff.  Great to start with, but you may still need to supplement the lessons in the book with some googling for things you don't understand.

Title: Re: UNIX Shell scripting
Post by Rad on Jun 13th, 2009 at 12:47pm

MrMagoo wrote on Jun 12th, 2009 at 6:43pm:
That's pretty basic stuff.

Really? It says "Advanced".

Seems that learning the UNIX/Linux shell is really about learning the commands, and what those commands do, and the various switches available to each command .. no?

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 13th, 2009 at 3:55pm
Ya.  If you understand everything in that course, you will have a very solid understanding of the basics.  It has everything you need for a good foundation.  But to call it 'Advanced' would be overly generous.  I wouldn't hire a Linux Admin who doesn't know at least 80% of that stuff off the top of his head, and he'd have to be at least familiar with the rest.

And ya, like I said in other post, learning the commands is the first half of the battle.  In some ways its the harder half.  That's not to say that it's hard.  I found it very frustrating at first because I knew exactly how to get things done in Windows, but had to research how to do even simple things in Linux.  Once you learn most of the basic commands, tho, your confidence will sky rocket and learning the rest gets a lot easier/faster.

The second half of the battle learning shell is understanding config files, environment variables, input and output, and things like that.  This is stuff you don't need just to get around in the shell, but for the advanced stuff it's essential.

As good as Ubuntu has gotten with automatic setup of things and providing graphical tools for the rest, there are still many things I prefer to do in the command line just because it's easier to get around and quicker to get things done. 

One other thing you will want to learn is the Vi text editor.  It's not very intuitive, but almost every distro comes installed with it, and you'll often have to make quick edits to config files.  I'll see if I can find a good tutorial on it and post it later.  It's pretty powerful once you get comfortable in it.

Title: Re: UNIX Shell scripting
Post by Rad.in.UbuntuVM on Jun 13th, 2009 at 5:53pm

MrMagoo wrote on Jun 13th, 2009 at 3:55pm:
But to call it 'Advanced' would be overly generous.

okay.


MrMagoo wrote on Jun 13th, 2009 at 3:55pm:
I wouldn't hire a Linux Admin who doesn't know at least 80% of that stuff off the top of his head,

eyebrow-raising statement


MrMagoo wrote on Jun 13th, 2009 at 3:55pm:
Once you learn most of the basic commands, tho, your confidence will sky rocket and learning the rest gets a lot easier/faster.

i am just beginning to experience this. For example, yesterday i updated the Movable Type blog software (to v4.26) .. which used to intimidate me, for fear of trashing the whole system, when I had to do everything file-by-file. Now I upload the entire archive to the server (quick), uncompress there (quick), and copy new files (overwrite) to their default locations.

All that remains is to click a few buttons saying, Ÿeah, I wanna update the program and database). Accomplished in less than 5 mins .. without even having to concentrate on what I was doing .. tho I *did* go back to notes Iǘe made on the procedure, and reference the commands detailed there, so I wouldnt (< theres that beep again) screw up. But I felt very good about how my skills are developing.


MrMagoo wrote on Jun 13th, 2009 at 3:55pm:
The second half of the battle learning shell is understanding config files, environment variables, input and output, and things like that. 

Dont really know what youŕe (<no beep there, so it only happens in certain instances) talking about there.


MrMagoo wrote on Jun 13th, 2009 at 3:55pm:
As good as Ubuntu has gotten with automatic setup of things and providing graphical tools for the rest, there are still many things I prefer to do in the command line just because it's easier to get around and quicker to get things done.

I witnessed this firsthand when I first got the VPS, and saw the admins there doing EVERYTHING in the command-line, and how EASY it was for them to accomplish these tasks, and how POWERFUL their commands were. The word > awe may be an exaggeration, but not a gross one.


MrMagoo wrote on Jun 13th, 2009 at 3:55pm:
One other thing you will want to learn is the Vi text editor. 

Youǘe (<there the apostrophe turns the v into a capital u, weird) mentioned before. I have this:

http://oreilly.com/catalog/9780596529833/

Amazon reviews look good:

http://www.amazon.com/Learning-Vim-Editors-Arnold-Robbins/dp/059652983X/

What are the other text editors and why do you prefer Vi/Vim? What about ... e-something? (I forget the name.)

RE: Command-line terminology, what do you know about options vs switches? Are they the same thing? Iǘe heard them called both. What is the skinny?

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 13th, 2009 at 7:25pm

Rad.in.UbuntuVM wrote on Jun 13th, 2009 at 5:53pm:
Dont really know what youŕe talking about there.

Don't worry, you don't need that stuff yet.  You are on the right track.  You can learn that stuff a little at a time, and it will be obvious when you need it.


Rad.in.UbuntuVM wrote on Jun 13th, 2009 at 5:53pm:
I have this:
http://oreilly.com/catalog/9780596529833/

Oreilly makes great books.  That one will have MORE than enough information on vi/vim.  My only bit of advice with that book is don't get too bogged down in it.  You probably need less than half the info in that book to use vi/vim effectively.  The rest of the info will be useful, but probably only marginally so at first.  Maybe best to read that book a few chapters at a time.


Rad.in.UbuntuVM wrote on Jun 13th, 2009 at 5:53pm:
What are the other text editors and why do you prefer Vi/Vim? What about ... e-something? (I forget the name.) 

Emacs and Nano are the two most popular substitues for vi.  There are probably hundreds that are less popular.

I think the reason I like Vi so much is because I've used it so much.  It is the default editor on most distributions (almost all Linux, Solaris, and BSD.)  So, I got used to it just because it was there so often.  I actually hated it at first, but once you get used to it, it gets the job done nicely. 

One thing I want to mention is that Vim is the newer version, and I highly prefer Vim.  Vi is much pickier, in my opinion, and doesn't handle the delete key or the arrow keys intuitively.  Many distributions (Red Hat, for sure) come installed with Vim, and alias it to Vi.  So, when you execute "vi somefile" you really end up opening that file in Vim.  I like this behavior. 

Ubuntu doesn't do that.  It ships with Vi only.  If you'd like to try out Vim, which I prefer, "sudo apt-get install vim" will install it.  Then just "vim somefile".


Rad.in.UbuntuVM wrote on Jun 13th, 2009 at 5:53pm:
RE: Command-line terminology, what do you know about options vs switches? Are they the same thing? Iǘe heard them called both. What is the skinny?

Most of the time the words switches, flags, and options all mean the same thing in this context.  Sometimes 'options' refers to settings stored in a config file somewhere rather than typed with every command.


Rad.in.UbuntuVM wrote on Jun 13th, 2009 at 5:53pm:
(Youǘe  <there the apostrophe turns the v into a capital u, weird)

I think your key mappings for your keyboard are set to something international.  Maybe French. 

Click on System->Administration->Languages and make sure it is set to US English.  Check for the same thing in System->Preferences->Keyboard->Layouts

Title: Re: UNIX Shell scripting
Post by Rad.in.UbuntuVM on Jun 13th, 2009 at 7:30pm
what does this do?

cd /

i mean, i know cd changes directory., but where does / take you?

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 13th, 2009 at 7:51pm
Heh.  It takes you to /.  '/' is the root of the file system.  Kinda confusing, I know. 

Also, don't confuse it with '/root', which is not the root directory, but the root user's home directory.  Most user's home directories are in /home/username, but the root user (administrator account) has their home directory in /root.  There is a good reason for this that I won't bother you with unless you are interested.

Have a look at pages 5-6 of my guide.  There's some more detail.

http://guides.radified.com/magoo/guides/linux/linux_partition_intro.html

Title: Re: UNIX Shell scripting
Post by Rad.in.UbuntuVM on Jun 13th, 2009 at 7:58pm
do you have a good online link to list of all major commands and their respective options?

Title: Re: UNIX Shell scripting
Post by Rad.in.UbuntuVM on Jun 13th, 2009 at 8:06pm
if i run my setUp.pl script from /cgi-bin directory, which sets all permissions for yabb forum installation files, can i just navigate to /cgi-bin, and enter setUp.pl and hit enter, or do i have to first call the perl prgm by entering

perl setUp.pl

??

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 13th, 2009 at 8:10pm
Nope, sorry.  I used to have one but I just checked and the link is dead.  Page 8 of my guide has a few of the most basic commands.  Page 1 has links to tldp, Linux.org, and Linix-tutorial, and you can find some good stuff there.  Otherwise, google.

The man pages will have all the flags of the commands, so once you find the right command, you are on your way.

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 13th, 2009 at 8:14pm

Rad.in.UbuntuVM wrote on Jun 13th, 2009 at 8:06pm:
if i run my setUp.pl script from /cgi-bin directory, which sets all permissions for yabb forum installation files, can i just navigate to /cgi-bin, and enter setUp.pl and hit enter, or do i have to first call the perl prgm by entering

It depends on if your system knows that it is a Perl file.  If the first line of the script is something like "#!/usr/bin/perl" it should work.  If not, you will have to add that line or use "perl setUp.pl".  The other thing to check is make sure the script permissions are set to executable.  "ls -l setUp.pl" will show you the permissions.


MrMagoo wrote on Jun 13th, 2009 at 7:25pm:
I think your key mappings for your keyboard are set to something international.  Maybe French. 

Click on System->Administration->Languages and make sure it is set to US English.  Check for the same thing in System->Preferences->Keyboard->Layouts

Any luck?

Title: Re: UNIX Shell scripting
Post by Rad.in.UbuntuVM on Jun 13th, 2009 at 8:14pm
ls -lax is same as ls -l -a -x .. right?

what about ls -l-a-x with no spaces between options

is that syntax correct?

does order matter?

how about ls -xal

is this functionally same as ls -lax?

what about double dash?

such as ls --l or ls --lax or ls -l--ax  ??

Title: Re: UNIX Shell scripting
Post by Rad.in.UbuntuVM on Jun 13th, 2009 at 8:16pm

MrMagoo wrote on Jun 13th, 2009 at 8:10pm:
The man pages will have all the flags of the commands,

not familiar with term > flag.

Title: Re: UNIX Shell scripting
Post by Rad.in.UbuntuVM on Jun 13th, 2009 at 8:19pm

MrMagoo wrote on Jun 13th, 2009 at 8:14pm:
The other thing to check is make sure the script permissions are set to executable.

what do you use for executable? 755?

when not using i set to 000

Title: Re: UNIX Shell scripting
Post by Rad.in.UbuntuVM on Jun 13th, 2009 at 8:25pm
for keyboard model, i am set to generic 105 intl PC. Not intuitively obvious what it should be set to.

layout is usa alternative international

advice?

so many options.

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 13th, 2009 at 8:43pm

Rad.in.UbuntuVM wrote on Jun 13th, 2009 at 8:25pm:
layout is usa alternative international

Set it to "US English".

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 13th, 2009 at 8:52pm

Rad.in.UbuntuVM wrote on Jun 13th, 2009 at 8:16pm:
not familiar with term > flag.



MrMagoo wrote on Jun 13th, 2009 at 7:25pm:
Most of the time the words switches, flags, and options all mean the same thing in this context.




Rad.in.UbuntuVM wrote on Jun 13th, 2009 at 8:19pm:
what do you use for executable? 755?

when not using i set to 000

Ya, 755 will work.  Anything that starts with 7.  744 or even 700 would be fine.

000 is a very odd permission, but I guess it does ensure it doesn't get executed.



Rad.in.UbuntuVM wrote on Jun 13th, 2009 at 8:14pm:
ls -lax is same as ls -l -a -x .. right?

Yes.



Rad.in.UbuntuVM wrote on Jun 13th, 2009 at 8:14pm:
does order matter?

Usually, no.  Sometimes, if there is more info after the flag, then it can matter.  For example, "tar -xzf filename" works, but tar -zfx filename" doesn't because the 'filename' has to be next to the 'f'.



Rad.in.UbuntuVM wrote on Jun 13th, 2009 at 8:14pm:
what about ls -l-a-x with no spaces between options

That won't work.



Rad.in.UbuntuVM wrote on Jun 13th, 2009 at 8:14pm:
what about double dash?

such as ls --l or ls --lax or ls -l--ax  ??

That won't work either.  The '--' is usually reserved for longer options or when the option name contains a '-' in it.  For example: "du -h --max-depth=1"

Title: Re: UNIX Shell scripting
Post by Spanky on Jun 13th, 2009 at 9:34pm
Back from dinner. Chicken & shrooms & rice in coconut milk gravy .. yummy.

Anyway, sorry to make you post same info twice. I think we musta both been posting at same time, cuz I missed one of your posts on page 1.

Will go back & make sure I got it all.

Title: Re: UNIX Shell scripting
Post by Rad on Jun 13th, 2009 at 9:36pm
BTW - here's mail from Nigel. I miss Nigel.


Quote:
Just some other things; you wrote on the forums that:

* Seems that learning the UNIX/Linux shell is really about learning the commands, and what those commands do, and the various switches available to each command .. no?

The answer to that is an emphatic *no*. The UNIX shell is a pretty powerful language in its own right, and you can do more with it than most people realise - frankly, the reason so many people seem to get so excited about Perl is they tend to learn it before the shell language, but actually Perl is a conceptual evolution from the shell language with none of the conceptual integrity (which doesn't make it not useful, but it's not worth learning for its own sake).

The shell language processes strings, by running a few simple substitution rules in order - which means that in terms of internal simplicity, it's actually quite like Scheme. Learning how to use the shell language well is a similar process to learning Scheme - because it has only a few facilities, learning it is mostly about getting used to the creative application of a few general problem-solving principles that serve you in good stead everywhere.

Now, learning the commands does matter in a practical sense for being familiar with UNIX generally, but that's nothing really to do with learning the shell at all. It's a much better and more powerful tool than that.

* do you have a good online link to list of all major commands and their respective options?

Everything in UNIX was standardised - proper, real agreed standards done by serious people - long ago before Linux started. It began with POSIX and AT&T took it even further by supporting a thing called the Single UNIX Specification which all the UNIX and UNIX-like operating systems could use (except for Linux which never followed it much, although that finally changed around 2000 when businesses started getting more involved and it began to be steered more by grown-ups).

The gold standard is the Single UNIX Specification and everything important is there; almost everything you need for most purposes is in Version 2, which you don't need to register to access.

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 13th, 2009 at 9:37pm

Spanky wrote on Jun 13th, 2009 at 9:34pm:
I think we musta both been posting at same time, cuz I missed one of you posts on page 1.

I had a feeling that happened.

Title: Re: UNIX Shell scripting
Post by Rad.in.UbuntuVM on Jun 13th, 2009 at 9:59pm
RE the keyboard setting, I set to USA English, but still getting beep at didnt apostrophe.

Maybe I need to restart?

Re Keyboard model, I see nothing obvious to select. I counted the keys on my (Gateway) laptop at 86. The lowest number in settings is 101.

Do you have any insight there?

Do I need to Apply System-wide?

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 13th, 2009 at 10:13pm

Rad.in.UbuntuVM wrote on Jun 13th, 2009 at 9:59pm:
Maybe I need to restart?

Probably.


Rad.in.UbuntuVM wrote on Jun 13th, 2009 at 9:59pm:
Re Keyboard model, I see nothing obvious to select. I counted the keys on my (Gateway) laptop at 86. The lowest number in settings is 101.

The "Generic Intel' one you said was selected should be fine.

Title: Re: UNIX Shell scripting
Post by Rad.in.UbuntuVM on Jun 13th, 2009 at 10:58pm
That wasnt Intel. It was Intl .. as in International.

Title: Re: UNIX Shell scripting
Post by Rad.in.UbuntuVM on Jun 13th, 2009 at 11:03pm
Restarted. Test > didn't. Hey it worked! No more beepage. Cool.

Title: Re: UNIX Shell scripting
Post by Rad.in.UbuntuVM on Jun 13th, 2009 at 11:09pm
The fonts here in Ubuntu don't look nearly as good as they do in Windows. For example, I set the font your reading now to Verdana, but I can tell this font in Ubuntu is NOT Verdana (which is a very readable font). This looks more like Arial or Helvetica.

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 14th, 2009 at 2:37am
Nice.  Glad we found it.

Title: Re: UNIX Shell scripting
Post by Rad.in.UbuntuVM on Jun 14th, 2009 at 1:58pm

MrMagoo wrote on Jun 13th, 2009 at 7:25pm:
Ubuntu doesn't do that.It ships with Vi only.If you'd like to try out Vim, which I prefer, "sudo apt-get install vim" will install it.Then just "vim somefile".

When I go to > Applications > Accessories > Text editor, I get gedit (not Vi). Sup wit dat?

When I go to > Applications > Add/Remove..., I see neither Vi nor Vim listed there. Why not?

When I select "Show All available applications" from the drop-down (in Add/Remove Applications), and search for Vim, I get only GVim returned. I don't understand why Vim wouldn't show.

Title: Re: UNIX Shell scripting
Post by Rad.in.UbuntuVM on Jun 14th, 2009 at 3:09pm
what do you think of this page?

http://www.ss64.com/bash/

it came up first when i searched google for "linux shell commands".

.. tho i noticed it doesn't list 'unzip' which is one of the commands i commonly use.

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 14th, 2009 at 5:43pm

Rad.in.UbuntuVM wrote on Jun 14th, 2009 at 1:58pm:
When I go to > Applications > Accessories > Text editor, I get gedit (not Vi). Sup wit dat?

When I go to > Applications > Add/Remove..., I see neither Vi nor Vim listed there. Why not?

When I select "Show All available applications" from the drop-down (in Add/Remove Applications), and search for Vim, I get only GVim returned. I don't understand why Vim wouldn't show. 

Those are all graphical applications.  The are designed to run from within Gnome (or another graphical desktop,) not from a shell.  They include mouse support and all kinds of modern graphical funness. 

GEdit works great.  If you editing a document from within the XWindows environment, gedit will do the job.  It even recognizes the syntax of many programing languages and provides color coding to help see what the code is doing. 

But, it needs a graphical environment, which your VPS doesn't provide, so you still need to learn vi or vim (or another text editor that doesn't need a graphical environment.) 

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 14th, 2009 at 5:46pm

Rad.in.UbuntuVM wrote on Jun 14th, 2009 at 3:09pm:
what do you think of this page?

Ya its far from all-inclusive, but it could come in handy.  All you really need to do is find a command that does what you need.  Then, you can use the man page to figure out how to use that command.  So, any pages like that you find can be useful while you are learning.

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 14th, 2009 at 5:51pm

Rad.in.UbuntuVM wrote on Jun 13th, 2009 at 11:09pm:
The fonts here in Ubuntu don't look nearly as good as they do in Windows.

sudo apt-get install ttf-mscorefonts-installer

Then restart Firefox.

Title: Re: UNIX Shell scripting
Post by Rad.in.UbuntuVM on Jun 14th, 2009 at 11:05pm

MrMagoo wrote on Jun 14th, 2009 at 5:51pm:
sudo apt-get install ttf-mscorefonts-installer

Then restart Firefox. 

Magic.

How come they don't install them by default?

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 14th, 2009 at 11:23pm

Rad.in.UbuntuVM wrote on Jun 14th, 2009 at 11:05pm:
How come they don't install them by default?

Not sure.  Probably has to do with license restrictions. 

Title: Re: UNIX Shell scripting
Post by Rad.in.UbuntuVM on Jun 14th, 2009 at 11:37pm

MrMagoo wrote on Jun 14th, 2009 at 5:43pm:
But, it needs a graphical environment, which your VPS doesn't provide,

for some reason, this distinction is hard for my brain to incorporate. obvious once it hits me.

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 15th, 2009 at 2:51am

Rad.in.UbuntuVM wrote on Jun 14th, 2009 at 11:37pm:
But, it needs a graphical environment, which your VPS doesn't provide, 

I don't want to confuse you further, but just to point out the flexibility of it all once you get to more advanced stuff, you could easily install a graphical environment on your server.  You don't even need to be connected to the server to use it.  You'd just need an X-client, which your Ubuntu VM provides.  So, you could install Xorg onto the server, then ssh into it with Xforwarding turned on.  When you launched a graphical application on the server, it would be displayed on your laptop.  You could interact with it as if it was running on your laptop.

In your case I don't recommend it.  First, it would run horribly slow over the internet.  Second, it would take up resources on your server (and might expose additional security risks.)  But, I have done it a few times over my home network.  Comes in handy in some very specific situations.  It works great.

More advanced than where you are at right now, but fun stuff.

Title: Re: UNIX Shell scripting
Post by Rad.in.UbuntuVM on Jun 15th, 2009 at 2:56pm

MrMagoo wrote on Jun 15th, 2009 at 2:51am:
I don't want to confuse you further,

Good luck.  :)


MrMagoo wrote on Jun 15th, 2009 at 2:51am:
you could easily install a graphical environment on your server.

Now ya got be thinking. For some reason I keep thinking of our VPS as not-mine. But as you infer (since it's a VPS) .. we could conceivably do whatever we want.

I shot off a sppt tik to WiredTree inquiring about X Windows GUI's and what's involved there. Not that I have decided to take that route, but just to clarify their position on the matter.


MrMagoo wrote on Jun 15th, 2009 at 2:51am:
You don't even need to be connected to the server to use it.You'd just need an X-client, which your Ubuntu VM provides.So, you could install Xorg onto the server, then ssh into it with Xforwarding turned on.When you launched a graphical application on the server, it would be displayed on your laptop.You could interact with it as if it was running on your laptop.

That would be gnarly-cool! I did not even know that was possible. And don't really understand it, even after you spelled it out .. but something there made me smile.


MrMagoo wrote on Jun 15th, 2009 at 2:51am:
But, I have done it a few times over my home network.Comes in handy in some very specific situations.It works great.

You have first-hand experience. Credibility.

Title: Re: UNIX Shell scripting
Post by Rad on Jun 15th, 2009 at 4:54pm

Quote:
Hi there.

This is an interesting question, but the short answer is that we don't support it, and we don't recommend it. Almost everything you would need to do should be doable from the WHM, and if there is something that needs to be done using a GUI, we can probably help you find a workaround faster than it would take to set up a proper GUI.

Just out of curiosity, what sort of usage did you have in mind when you thought to set up x windows?

They're interested and curious.  :)

Title: Re: UNIX Shell scripting
Post by Rad.in.UbuntuVM on Jun 15th, 2009 at 7:28pm
From Mike:


Quote:
This is what I was thinking.  If you're comfortable enough with ssh and x windows to do this, you're welcome to try.  It will be really slow over the internet, though. 

I'm still not sure what you need this for, but I'd guess that there are better ways to accomplish this than X11 forwarding.  I guess it would really depend on exactly what you're trying to do/set up.

From Joe (the lead/head sppt guru at WT, who knows a lot):

Quote:
Just adding my 2 cents in here.  Adding Xwindows to your server is most likely a bad idea.  X11 requires a ton of memory to operate correctly and I wouldn't add it if I was you.

Title: Re: UNIX Shell scripting
Post by Rad on Jun 15th, 2009 at 10:28pm
I was looking at the man pages for tar and noticed in the first example listed there, they use *2* 'v' options >  tar -xvvf foor.tar

I cannot understand why you would EVER use two of ANY options. Do you?

the v option if for/to verbosely list files processed (whatever that means).

And then I was under the assumption that options were ALL single letters, but a review of this man pages indicates this is not true .. that you have options such as --version

Seems that if the option uses more than a single letter, it uses a double-dash .. yes? Is this the rule/syntax?

Title: Re: UNIX Shell scripting
Post by Rad on Jun 15th, 2009 at 10:38pm
Re the Vim install, it is suggesting the following packages:

ctags
vim-doc
vim-scripts

Should I?

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 15th, 2009 at 10:43pm

Rad.in.UbuntuVM wrote on Jun 15th, 2009 at 7:28pm:
X11 requires a ton of memory to operate correctly and I wouldn't add it if I was you. 

Like I said, I wouldn't recommend it either for mostly the same reasons.  Just fun to think about the possibilities.

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 15th, 2009 at 10:46pm

Rad wrote on Jun 15th, 2009 at 10:28pm:
I cannot understand why you would EVER use two of ANY options. Do you?

the v option if for/to verbosely list files processed (whatever that means).

This is not uncommon.  The v option gives you verbose output.  Additional v's make it ever more verbose.  Can't think off the top of my head, but I know I've seen at least one command that supports up to 4 v's for extremely verbose output.  Usually, the more verbose the output, the more you have to know about the lower workings of the command to get any use out of the information.


Rad wrote on Jun 15th, 2009 at 10:28pm:
Seems that if the option uses more than a single letter, it uses a double-dash .. yes? Is this the rule/syntax?

This is very true in the general case, but not a hard set rule.  Like the pirate's code, it is a sort-of guideline.

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 15th, 2009 at 10:48pm

Rad wrote on Jun 15th, 2009 at 10:38pm:
Re the Vim install, it is suggesting the following packages:

vim-doc might not be bad to have, but you really don't need any of them.  The packages that apt-get suggests after an install usually provide auxiliary functionality or documentation.  You don't need them to use vim effectively.

Title: Re: UNIX Shell scripting
Post by Rad.in.UbuntuVM on Jun 17th, 2009 at 12:26am
i have about 20 directories in my / directory.

do you have a reference that describes what each is for?

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 17th, 2009 at 3:25am

Rad.in.UbuntuVM wrote on Jun 17th, 2009 at 12:26am:
do you have a reference that describes what each is for?

Here is 13 of them:
http://guides.radified.com/magoo/guides/linux/linux_partition_explanation.html

Some of the one's that I have on my system not mentioned in the guide are:
lib/lib32/lib64 - hold library files (sorta like a DLL)
lost+found - kinda just what it says - files that the system thinks aren't where they belong
media - has mount points for removable media like CD's and USB disks
opt - sometimes used for optional software
selinux - used by selinux

Title: Re: UNIX Shell scripting
Post by MrMagoo on Jun 29th, 2009 at 2:42am
Off-Topic replies have been moved to this Topic.

Radified Community Forums » Powered by YaBB 2.4!
YaBB © 2000-2009. All Rights Reserved.