Zoklet.net

Go Back   Zoklet.net > Technology > Technophiles and Technophiliacs

Reply
 
Thread Tools
  #1  
Old 04-02-2012, 07:31 PM
i poop in your cereal's Avatar
i poop in your cereal i poop in your cereal is offline
Archduke
 
Join Date: Jan 2009
Location: Noddington
Thanks: 341
Thanked 601 Times in 409 Posts
Mad Help with PowerShell tutorial

So, I've been going through this guide smoothly up until this point:
http://cli.learncodethehardway.org/b...oursech21.html

I'm using Windows 7, and I have absolutely no fucking clue what he's going on about. I put in the get-childitem Env: and then receive some info alright, but after that I'm lost. I don't see any additional commands for windows anywhere, yet he's talking about specifying the search, and for the final task of "... go online and research how you change your PATH for your computer" I have zero idea what's going on. None whatsoever.

What path? What? What?
Reply With Quote
  #2  
Old 04-02-2012, 09:30 PM
LSA King's Avatar
LSA King LSA King is offline
Acolyte
 
Join Date: Jan 2009
Location: PNW
Thanks: 57
Thanked 720 Times in 502 Posts
Default Re: Help with PowerShell tutorial

PowerShell is Microsoft's new way of saying "Fuck it, we'll give you Linux lovers and uber Power Users a full shell environment again". It's kind of new and as far as I can tell they're trying to make it as similar to Unix/Linux as possible command and function wise so you don't have to learn completely different environments again.

FYI as shitty as Windows 8 will end up being, it's planning to increase PowerShell commands from the current 200 or so to 2,000+ which will be good for some people who get there rocks off in the CLI.

TBH it still looks like more hassle than it works. The top graph is comparing Unix (MacOS)/Linux shell environment commands to the equal commands in PowerShell, and just looking at that I'm face palming as to why they are making that such a big difference. I don't see what the big deal is to change "echo $PATH" to $env-PATH, seems kind of silly fucking retarded to me.

Basically that's all that little guide is saying. "The shell has certain variables that come with it (usually all capitalized) such as PATH, PWD (Linux) and OS, TEMP, PROMPT (PowerShell). This is how to echo those variables, now why don't you Google and find out how to modify a given variable, in this case the PATH variable."

Answer: *> refers to the prompt*

>$env-PATH

---PATH to your account shows---

Change PATH variable

http://stackoverflow.com/questions/7...-path-variable

Code:
$env:Path = "SomeRandomPath";
Example:

Code:
$env:Path = $env:Path + ";C:\Program Files\GnuWin32\bin"

Hopefully they make PowerShell as useful as BASH is, Windows might get some respect back from the hardcore users so long as they stop fucking up the commands, keep them similar to Linux as much as possible.
__________________
http://www.whatreallyhappened.com
U.S. #1 Financier of Terrorism
Reply With Quote
The following users say "It is so good to hear it!":
i poop in your cereal (04-02-2012)
  #3  
Old 04-02-2012, 10:16 PM
i poop in your cereal's Avatar
i poop in your cereal i poop in your cereal is offline
Archduke
 
Join Date: Jan 2009
Location: Noddington
Thanks: 341
Thanked 601 Times in 409 Posts
Smile Re: Help with PowerShell tutorial

Thanks. I'm still not entirely sure what's meant specifically by "PATH" though. I know what the word means, obviously, but could you try to give me a clearer definition of it in this specific context? I'm a complete newbie to tech stuff and I'm kinda high, so explain it as you would to a 12 year old with down syndrome.

Also, the reason I'm doing this is 'cause I'd like to try to learn some basic programming. After doing a little bit of reading, I've come to believe that Python is a pretty decent place to start. Would you agree with that?
Reply With Quote
  #4  
Old 04-02-2012, 10:35 PM
LSA King's Avatar
LSA King LSA King is offline
Acolyte
 
Join Date: Jan 2009
Location: PNW
Thanks: 57
Thanked 720 Times in 502 Posts
Default Re: Help with PowerShell tutorial

lol I know how it is. I just finished a Intro to Commandline (DOS/Unix) and Intro to Unix course a couple of weeks ago which is the only reason I remotely understand this stuff. Gotta break in somewhere and it can be hard to learn and understand on your own or through a book.

I think Wikipedia can pretty much sum it up better than I can. I would have probably butchered it and I'm sure some Linux pro can explain any questions if you still have any after that.

http://en.wikipedia.org/wiki/PATH_(variable)

Quote:
PATH is an environment variable on Unix-like operating systems, DOS, OS/2, and Microsoft Windows, specifying a set of directories where executable programs are located. In general, each executing process or user session has its own PATH setting.
Pretty much states the obvious. Since I'm still getting into the CLI myself I can just tell you from my Linux experience at college. I log in remotely to a Linux server (PuTTy), my user account is my home directory. Executing the PATH variable lists the default paths in which to search for executable files when executing commands or files. That may not be entirely accurate but it's the only logic I can explain with at my level that allows me to make sense without over complicating things. You can add as many directories to the PATH variable as you wish, often separating by character such as ":" or ";" for Powershell.
__________________
http://www.whatreallyhappened.com
U.S. #1 Financier of Terrorism
Reply With Quote
  #5  
Old 04-03-2012, 11:26 AM
i poop in your cereal's Avatar
i poop in your cereal i poop in your cereal is offline
Archduke
 
Join Date: Jan 2009
Location: Noddington
Thanks: 341
Thanked 601 Times in 409 Posts
Default Re: Help with PowerShell tutorial

I don't get it. If PATH specifies the location of files to be executed, why would I ever change that? Wouldn't it just fuck shit up? I'm completely lost. This tutorial really doesn't do a good job of explaining what is actually happening.
Reply With Quote
  #6  
Old 04-04-2012, 03:06 PM
sevenTwo sevenTwo is offline
Super Novice
 
Join Date: Feb 2009
Location: Bay life
Thanks: 73
Thanked 121 Times in 97 Posts
Default Re: Help with PowerShell tutorial

When you type in a command, it looks in the PATH directories for the utility you want to use.

Suppose you wanted to run the utility `ls` and your PATH looked like this:
Code:
/usr/local/apache-maven-3.0.4/bin:/usr/local/homebrew/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/git/bin:/Users/seventwo/aspectj1.6/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/texbin
It would look for the utility program ls in
/usr/local/apache-maven-3.0.4/bin

If it exists in that directory, it will run that program.
otherwise it will look into the next directory:
/usr/local/homebrew/bin

... so on and so forth. It goes through that list in order and will stop as soon as it finds the first program with the same name.

When you change your PATH variable, you typically just want to add some directory to it so you can run the utility program just by calling its name (, opposed to typing out the full location of the file).

Ex.
Appending /Users/seventwo/aspectj1.6/bin to my PATH variable allows me to run my AspectJ program by simply typing `aj` rather than `/Users/seventwo/aspectj1.6/bin/aj`

As you can see from my example, it is simply a matter of convenience. It typically doesn't screw things up unless you clutter your PATH variable with a ton of different directories.

DISCLAIMER: My example is catered more for Unix-like systems, but PowerShell has similar concepts... Syntax is going to be different with PowerShell.

Last edited by sevenTwo; 04-04-2012 at 03:09 PM.
Reply With Quote
The following users say "It is so good to hear it!":
i poop in your cereal (04-06-2012)
Reply

Bookmarks

Tags
powershell, tutorial

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I'm learning how to do stuff in PowerShell i poop in your cereal Bat Country 6 04-03-2012 02:24 AM
The Tutorial Thread Skittles Visual Arts 66 02-03-2011 12:38 AM
Tutorial on proxies TwinkleTits Network Security & Hacking 16 06-11-2010 02:12 AM
Tutorial: How to become a moderator Angry Blue Bird of Death Bat Country 11 01-02-2010 01:43 PM
Hitman Tutorial. Mor3BL7 LOL, Internet 10 11-07-2009 05:38 AM


All times are GMT. The time now is 07:41 AM.


Hot Topics
On IRC
Users: 4
Messages/minute: 0
Topic: "http://www.zoklet.net/..."
Users: 21
Messages/minute: 0
Topic: "ask ibm why atlantis is real"
Users: 9
Messages/minute: 0
Topic: "vaginaboob"
Advertisements
Your ad could go right HERE! Contact us!

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.