• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

what's your favorite shell?

vital

Platinum Member
mine is bash

Current available shells:
/bin/sh
/bin/bsh
/bin/csh
/bin/ksh
/bin/tsh
/usr/bin/sh
/usr/bin/bsh
/usr/bin/csh
/usr/bin/ksh
/usr/bin/tsh
/usr/local/bin/tcsh
/bin/true
/usr/sbin/uucp/uucico
/usr/local/bin/bash
/bin/false
/usr/sbin/snappd
 
I like the new MSH (Microsoft Shell) which you can read about here.

It can do some really nifty stuff. One of the cooler features is the support for multiple shell "personalities". They have broken up typical command-shell activities into basic commands, which you can then alias to "commandlets" which are more appropriate for the personality you seek. There are built-in ones for Unix-type behavior, or DOS-type behavior, or you can create your own. They're more powerful than typical Unix aliases because the built-in commands available for mapping are more granular than typically found at the shell level.

Another cool feature is the structured object pipeline support. Rather than just plain-old text pipes, you can pipe full .NET objects from one command to the next, which exposes all kinds of really cool things to the command line. Like, "list_processes | sort (cpu_usage) | draw_bar_graph( cpu_usage )" Obviously that's not the right syntax, but you get the idea: just about any class in the .net framework is available on the command line as a utility, assuming you keep calling objects which support the object pipeline. If you want to pipe to plain old vanilla processes, of course that's still available, but your pipeline gets converted to serialized to text (if that's possible).

Edit: but on unix, \bin\false is the way to go, for sure. I'm using that one now as I type. It's just tricky to log into... 😛
 
I like the new MSH (Microsoft Shell) which you can read about here.

Yay, more software from MS that we can't even see because of closed development.

They're more powerful than typical Unix aliases because the built-in commands available for mapping are more granular than typically found at the shell level.

Huh?

Another cool feature is the structured object pipeline support. Rather than just plain-old text pipes, you can pipe full .NET objects from one command to the next, which exposes all kinds of really cool things to the command line. Like, "list_processes | sort (cpu_usage) | draw_bar_graph( cpu_usage )"

While that's cool in theory and I'm sure people will actually use it, one of the benefits of using shell scripts is because it's all text and it's simple. You don't have to worry about object types, what can accept what, etc you just pipe it through cut and grep and pick out what you want and if you want to get complicated you break out perl.
 
Has microsoft figured out forking proccesses yet?

Has they figured out how to do multitasking from a command line, yet?

Like on bash... your editing a text file using vi, I want to play some music, so I go:

I hit ctl-z, which stops and puts the proccess into the background.
Then I realise I need to rebuild my playlists since I ripped some music a while ago, so I run this script I made:
#!/bin/bash

find ~/music | while read i
do
if file $i | grep MP3 2>&1 /dev/null
then
echo $i
fi
if file $i | grep audio 2>&1 /dev/null
then
echo $i
fi
done
My command is:
makemusic > ~/playlist.m3u

Then I start xmms's gui:
xmms ~/playlist.m3u 2>&1 /dev/null &

Then I remember I want to record this movie on HBO that starts at 5pm. I figure it'll last a little bit over 2 hours 15minutes. So I go
at 17:00
ptune.pl -d /dev/video1 -c 15
killall mplayer (sometimes mplayer keeps a file open for some reason)
cat /dev/video1 > ~/recorded/generic.movie.mpeg2 &
KILLME=$!
sleep 180m
kill $KILLME
kill -9 $KILLME
<ctl-d>

then I need to get back to work so I go:
fg 1
and start editing agian.

Can you do something similar in the new MS shell?

Maybe, maybe not. Not that I expect that many people would need functionality like that!!! but I am just that much of a nerd. I never messed around with NT's CLI much, it was always a pain, and to do stuff like while loops and such in batch files looked like a horror to try to do, and required some sort of programming degree or something.

Bash shell is easy. Scripting is easy. You just have to learn the syntax for doing tests, variables, and doing if/while loops and your set. Maybe you'd have to learn some awk or sed if you want to do real text manipulation. The rest is the same as if your typing stuff out yourself. Anything more complicated you use Python or perl.

But I'd still bet that you'd wouldn't have anything near to dd for MS, and if you did it wouldn't probably be that usefull...

Like being able to go: dd if=/dev/cdrom of=cdrom.image.iso? Takes more then a slick shell syntax to make a realy usefull command line enviroment.

I knew that MS was working on something like that, though. One of Window's big deficite as a server OS was lack of good automation/scripting type stuff. But it's like the old saying goes "Those who do not copy Unix are doomed to recreate it." 😉
 
Here is a another article on commandlets and MSN stuff...
linky

They have a sample commandlet:
/*
Sample commandlet: get/machinesettings
*/
using System;
using System.Diagnostics;
using System.Management.Automation;

namespace GetMachineSettings
{
/// <summary>
/// Get/Machinesettings
/// </summary>
[CmdletDeclaration("get", "machinesettings")]
public class GetPs: Cmdlet
{
public string MachineName=Environment.MachineName;
public override void StartProcessing()
{
WriteObject("Current Machine Info");
WriteObject("--------------------");
}

[ParsingMandatoryParameter]
[ParsingPromptString("Enter either MACHINE for machine "
+"information or ENVIRONMENT for environment variables")]
public string InfoType;


public override void ProcessRecord()
{
if (InfoType.ToLower() == "machine")
{
WriteObject(MachineName);
WriteObject("Computer Name: " +
Environment.MachineName);
WriteObject("OS: " +
Environment.OSVersion.ToString());
WriteObject("System Directory: " +
Environment.SystemDirectory);
WriteObject("Current User Name:" +
Environment.UserName);
WriteObject("FrameworkVersion: " +
Environment.Version.ToString());
}
else if (InfoType.ToLower() == "environment")
{
WriteObject(MachineName);
WriteObject(Environment.GetEnvironmentVariables());
}
else
{
WriteObject("Invalid selection; accepted values " +
"are MACHINE and ENVIRONMENT.");
}
}

}

}

Ouch. 😛

Although I don't suppose doing the same in Linux would be any easier/simplier.
 
I think I like both Bash and Korn shells about the same ...
at home I use Bash most of the time, at work It's almost always Korn (well ... some Bourne even) ...
They for the most part are similar enough, that I don't get too confused.
 
Originally posted by: drag
Has microsoft figured out forking proccesses yet?
Yes, try "start <process_name>". Or "help start" if you don't know how to use start. It's roughly the equivalent of unix's "nice" and "&amp;" wrapped into one, with a few extra features thrown in.

Has they figured out how to do multitasking from a command line, yet?
"Suspend" has never, ever been necessary or useful in Windows. Historically it was important in Unix because people worked at text-only consoles that could not be spawned at will.

But since the early 90's we have developed "Windowing Systems" where as many console windows may be spawned as you would like. Each text-mode process can live in its very own console window, eliminating the need to switch between processes in a single console! (Yay, progress!)

#!/bin/bash

find ~/music | while read i
do
if file $i | grep MP3 2>&amp;1 /dev/null
then
echo $i
fi
if file $i | grep audio 2>&amp;1 /dev/null
then
echo $i
fi
done
Take it from me, but this script is nearly identical in Win2k/XP shell script.

My command is:
makemusic > ~/playlist.m3u

Then I start xmms's gui:
xmms ~/playlist.m3u 2>&amp;1 /dev/null &amp;
Ok, I don't mean to point out the obvious, but NO ONE using Windows would manage their mp3's this way. Get an app with a file library that supports file-system notifications (or heck, even auto-scan would be better than that)! Yikes!

And I hesitate to point this out because some of the WinFS features may ship post-Longhorn, but using MSH and its native support for attributed file metadata from WinFS means that your shell script could do MUCH more than just select by searching for the strings "mp3" or "audio". It could directly inspect the ID3 information and make selections directly based on that data, or any other custom attributes that you or any other app has registered. (Yay, progress!)

Then I remember I want to record this movie on HBO that starts at 5pm. I figure it'll last a little bit over 2 hours 15minutes. So I go
at 17:00
Works in NT.
ptune.pl -d /dev/video1 -c 15
Would work in NT if someone really wanted to write an app that accepted raw device strings from the command line. Why you'd want to specify a time and channel to record rather than just tell the app which show you want to record (or better yet, pick it from a nicely populated program guide) is a question I'll leave to you.
then I need to get back to work so I go:
fg 1
and start editing agian.
Can you do something similar in the new MS shell?
No, but I've already explained why this problem from the 1970s and 80s isn't relevant today.

Maybe, maybe not. Not that I expect that many people would need functionality like that!!! but I am just that much of a nerd. I never messed around with NT's CLI much, it was always a pain, and to do stuff like while loops and such in batch files looked like a horror to try to do, and required some sort of programming degree or something.
A nerd running Linux entirely from the command line, but without the ability to write a Windows shell script, is not a nerd, but a "Windows Newbie."

Bash shell is easy. Scripting is easy. You just have to learn the syntax for doing tests, variables, and doing if/while loops and your set. Maybe you'd have to learn some awk or sed if you want to do real text manipulation. The rest is the same as if your typing stuff out yourself. Anything more complicated you use Python or perl.
The object model in MSH is so easy and natural that it makes awk, sed, and Perl look like Tensor Calculus. Why on earth would you WANT to do text processing if you can avoid it? That's one of the most error-prone scripting tasks of all time. It's responsible for more bugs, security holes, embarrassing data loss, and general confusion than just about any other programming task short of thread synchronization. If you can just pass objects from one command to the next, and each command knows what type it's dealing with, say goodbye to text processing! (Yay, progress!)

Like being able to go: dd if=/dev/cdrom of=cdrom.image.iso? Takes more then a slick shell syntax to make a realy usefull command line enviroment.
Agreed. Although "cdburn" does what you are describing quite nicely, and with more useful context-sensitive help and more complete imaging and writing options.

Everyone who seriously administers Windows has installed the Resource Kit Tools and, combining those with what comes with a default Pro install, has a lot of command-line power.

But it's like the old saying goes "Those who do not copy Unix are doomed to recreate it." 😉

How about, "Those who know only Unix will never supersede it."
😉

Yay, progress!
 
Originally posted by: kylef
Originally posted by: drag
Has microsoft figured out forking proccesses yet?
Yes, try "start <process_name>". Or "help start" if you don't know how to use start. It's roughly the equivalent of unix's "nice" and "&amp;" wrapped into one, with a few extra features thrown in.

Has they figured out how to do multitasking from a command line, yet?
"Suspend" has never, ever been necessary or useful in Windows. Historically it was important in Unix because people worked at text-only consoles that could not be spawned at will.

But since the early 90's we have developed "Windowing Systems" where as many console windows may be spawned as you would like. Each text-mode process can live in its very own console window, eliminating the need to switch between processes in a single console! (Yay, progress!)

#!/bin/bash

find ~/music | while read i
do
if file $i | grep MP3 2>&amp;1 /dev/null
then
echo $i
fi
if file $i | grep audio 2>&amp;1 /dev/null
then
echo $i
fi
done
Take it from me, but this script is nearly identical in Win2k/XP shell script.

My command is:
makemusic > ~/playlist.m3u

Then I start xmms's gui:
xmms ~/playlist.m3u 2>&amp;1 /dev/null &amp;
Ok, I don't mean to point out the obvious, but NO ONE using Windows would manage their mp3's this way. Get an app with a file library that supports file-system notifications (or heck, even auto-scan would be better than that)! Yikes!

I haved used apps that autoscan stuff before. Zinf is one, it's pretty nice and you can create playlists and such easily. It will automaticly arrange everything according to artist, genra, album. It's actually realy slick and has a few capabilities that exceed other things such as itunes.

Why? Because my script autoscans and does all the arranging I need. When I rip files they are automaticly put in the ~/music file, and are in individual folders named after the artist and album. That's all I need, this way it's much simplier and faster then having to go thru a gui for me. That's all. It's just much less of a hassle.
And I hesitate to point this out because some of the WinFS features may ship post-Longhorn, but using MSH and its native support for attributed file metadata from WinFS means that your shell script could do MUCH more than just select by searching for the strings "mp3" or "audio". It could directly inspect the ID3 information and make selections directly based on that data, or any other custom attributes that you or any other app has registered. (Yay, progress!)

Sure if you go thru the trouble of having to setup the extra metadata type stuff that the winfs uses to orginize everything or only use apps that do all that automaticly. Not also to mention that WinFS is still non-existant.

I could do it thru id3 tags to thru command line if I felt like it. But thats something I dont' care about. Instead I use file that goes in and detects the actual file and outputs them for me, I just use the strings audio and mp3 because that's what is in the file commands output. Actually it's better then what Windows does, I could name the file anyting I wanted, including screwing up the .mp3 or .ogg filenames, and guess what? It'd still work out just fine.

But that's besides the point. I use different little scripts a hundred times a day, lots of stuff is much simplier and conveinent. That's just me.

I can type fairly fast and I aviod using the mouse and avoid nasties like repetative stress injuries type stuff by having to swing that rat around my desktop clicking on hundreds of little icons and menu entries.

but that's just me. Also if I don't feal like typing the command out, I can just add it to crontab and have it automaticly done every night.

What pains would you have to go thru with a GUI tool to get it to update it's file scans every night? Especially when the designer didn't think of adding that feature?

Then I remember I want to record this movie on HBO that starts at 5pm. I figure it'll last a little bit over 2 hours 15minutes. So I go
at 17:00
Works in NT.[/quote]

Yet another instance of NT copying unix.
ptune.pl -d /dev/video1 -c 15
Would work in NT if someone really wanted to write an app that accepted raw device strings from the command line. Why you'd want to specify a time and channel to record rather than just tell the app which show you want to record (or better yet, pick it from a nicely populated program guide) is a question I'll leave to you.

Sometimes I use Mythtv, other times I don't. Depends on the mood I am in. What is the point of the hassle of going all the way to the start menu, opening up a app, selecting the things I want from various menus and dialogs to get it to do what I want, when I dont' have to?
then I need to get back to work so I go:
fg 1
and start editing agian.
Can you do something similar in the new MS shell?
No, but I've already explained why this problem from the 1970s and 80s isn't relevant today.

for you. I ssh into my machines usually. I have 5 computers in my home setup, I screw around with all of them from my laptop.

All thru SSH. Remote administration.

Can you sit in another part of your house on your laptop or palm pilot or whatever and play music on your stereo in another part of the house?

I can, I go:

ssh spock makemusic
ssh spock xmms &amp;

whala. X11 tunnels thru ssh and it's easy. No extra program, no having to add a webbased thingy or mp3 player. no sharewere no nothing.

Look a GUI working VIA command line transparently OVER a network!
yay progress!

I don't use scripts and stuff because I HAVE TOO. I use it because it's easy and convient for me to do so. I am not beholdent on my scripting ability any more then any Windows user.

I brought up those examples because I want to know if the MS shell has the capabilities and flexibilties that is needed to get the same amount of work done, and the same type of work done.


Maybe, maybe not. Not that I expect that many people would need functionality like that!!! but I am just that much of a nerd. I never messed around with NT's CLI much, it was always a pain, and to do stuff like while loops and such in batch files looked like a horror to try to do, and required some sort of programming degree or something.
A nerd running Linux entirely from the command line, but without the ability to write a Windows shell script, is not a nerd, but a "Windows Newbie."

Ya but we are not talking about newbies, we are talking about administrators attempting to administrate complicated servers from a command line. The ability to easily automate a system, bring up usefull scripts.

Get the same work that done in 15 minutes that would take multiple gui users hours to complete, thru automation.

Bash shell is easy. Scripting is easy. You just have to learn the syntax for doing tests, variables, and doing if/while loops and your set. Maybe you'd have to learn some awk or sed if you want to do real text manipulation. The rest is the same as if your typing stuff out yourself. Anything more complicated you use Python or perl.
The object model in MSH is so easy and natural that it makes awk, sed, and Perl look like Tensor Calculus. Why on earth would you WANT to do text processing if you can avoid it? That's one of the most error-prone scripting tasks of all time. It's responsible for more bugs, security holes, embarrassing data loss, and general confusion than just about any other programming task short of thread synchronization. If you can just pass objects from one command to the next, and each command knows what type it's dealing with, say goodbye to text processing! (Yay, progress!)[/quote]

Realy.

You got any examples about how easy it is to program using these .NET streams? The one that I found looked pretty damn complicated.

And how is text parsing that much more horrible then any other programming? All programming is error-prone.

Like being able to go: dd if=/dev/cdrom of=cdrom.image.iso? Takes more then a slick shell syntax to make a realy usefull command line enviroment.
Agreed. Although "cdburn" does what you are describing quite nicely, and with more useful context-sensitive help and more complete imaging and writing options.[/quote]

What context sensitive help do you need to generate a ISO image?

DD is also able to mirror drives, and partitions. You can back up master boot records. You can convert data from one format to another. Is cdburn going to do that for me, or will I have to figure/install out dozens of other programs?
Everyone who seriously administers Windows has installed the Resource Kit Tools and, combining those with what comes with a default Pro install, has a lot of command-line power.

But it's like the old saying goes "Those who do not copy Unix are doomed to recreate it." 😉

How about, "Those who know only Unix will never supersede it."
😉

Yay, progress!

That's why after saying that DOS is dead and NT will supersede Unix from freindly gui's and wizards that any admin can use they have to now go back and create a new powerfull command line enviroment in order to get a OS powerfull enough to compete with Unix.

Sounds like back to the future to me.


Another example (maybe a bit more impressive, maybe not):

I bought a new harddrive, but I ran out of time to do what I wanted to get done at home, so I stuck in the drive booted up with a live-linux cdrom and turned on ssh on it.

I wanted to rearrange the partitions on the harddrive because they were all messed (the order of them and the sizes) from installing numerous extra OSes on my computer and getting rid of them. Just to play around with new things. Plus I wanted to switch from ext3 to XFS

Once I got to work and had some extra time on my hands, I partitioned the extra harddrive it was going to be my new /home directory. I copied over all my user files to my new directory to it, then I copied all my system files over to it.

I ran a couple du -ha > log type commands against the original system and my backups then I ran diffs against the logs and made sure that they all matched up. All that was different was the directory file sizes since XFS was a bit more effcient then ext3. So then I wiped out the partitions on my original harddrive. For some reason all my constant rearranging of stuff left it a little screwy so I did a little "dd if=/dev/zero of=/dev/hda" type thing on it just to make sure that I had a clean slate.

After I got back from lunch I formatted and partitioned my original harddrive. I enlarged the partition for the system files this time for stuff like ut2004 wich required something like 4 gigs of space. I also then had a large empty space to play around with. That and everything was now XFS except my new /boot partition.

Then I copied my system files back over. made a new /proc, /tmp and /dev directories and ran the MAKEDEV scripts.

Then I decided it was a nice time to update my kernel, so I downloaded and installed a new kernel (all thru the magic of chroot).

I then edited my /etc/fstab file and made sure that was correct.

Then I reinstalled my boot loader and made sure that all of it's settings were correct.

Then that was that. When I got home all I did was double check everything, pop out the cdrom and reboot.

No sweat and I was like I never did anything, the only difference was that I had a lot more disk space.

I've installed gentoo from work on one of my PC's one things were getting slow at work once another time. Hell if I had to I could setup a entire production server, with a webserver, database, whatever you want. And guess what? Even though It took a long time compiling that stuff I just used screen and monitored it's progress time to time, irregardless of what computer I was on.

Sure you got vnc and remote desktop type stuff, but why go thru all that hassle? Ssh does everthing I need or want. The GUI is always their if I feel like using it. I use GUI for lots of stuff, when it's convienent and easy for me. I don't surf the web with Links do I? I don't edit pictures or movies in the command line do I? No of course not.

I have little launchers and do-dads and stuff for most of the stuff I do. I even put launchers on the task bar that run various scripts. I used a automount script, why? Because it's more convient for me to do so then set a default behavior for a gui to respond to.

It's not about who has the alpha nerd OS here, it's about the capabilities of the stupid thing. I know that a command line can be a very powerfull, usefull, and convienent for a experianced user to use if the OS itself is setup correctly to use it, even if you don't see that.

I am just curious about what sort of things you can do with MS's stuff now that they redid everything.
 
Originally posted by: kylef
I like the new MSH (Microsoft Shell) which you can read about here.

It can do some really nifty stuff. One of the cooler features is the support for multiple shell "personalities". They have broken up typical command-shell activities into basic commands, which you can then alias to "commandlets" which are more appropriate for the personality you seek. There are built-in ones for Unix-type behavior, or DOS-type behavior, or you can create your own. They're more powerful than typical Unix aliases because the built-in commands available for mapping are more granular than typically found at the shell level.

Another cool feature is the structured object pipeline support. Rather than just plain-old text pipes, you can pipe full .NET objects from one command to the next, which exposes all kinds of really cool things to the command line. Like, "list_processes | sort (cpu_usage) | draw_bar_graph( cpu_usage )" Obviously that's not the right syntax, but you get the idea: just about any class in the .net framework is available on the command line as a utility, assuming you keep calling objects which support the object pipeline. If you want to pipe to plain old vanilla processes, of course that's still available, but your pipeline gets converted to serialized to text (if that's possible).

Oh.. WOW.. that sounds cool. Actually, it sounds a lot like some of my ideas for an "ideal shell" environment, object-oriented, utilizing lamda-calculus, and a sort of noun/verb arrangement, with natural set/tree/collection-oriented primitives (kind of like globbing, but slightly more powerful), combined with a few "-isms" that I found useful from VMS back in the day.

It was meant to go along with my storage model and namespace that was very similar in concept in many ways to ReiserFS4, and WinFS, from what little I know about it. Probably more similar to reiser. I wish I had followed-though on that project to completion, a few years back. It looks like MS has caught-up to some of my ideas. 🙂 They still haven't quite gotten to the point of a single, global, unified, distributed namespace, for both the system, running applications, and the storage/filesystem. The problem is, the ideal model would require visibility into applications and storage formats for maximum usability and scripability, and openness in formats is just something MS would never go for. Their lifeblood is propriety and control, not openness and real innovation, sadly. ".Net" is a start though.

Edit: double-cool, they used some (syntactical) VMS-isms too!
MSH C:\> get/process | where/object "handlecount -gt 400" | format/list
or
MSH C:\> get/process | where/object -Expression "processname -like *cs*"
 
funny you mention vms. It's at the roots of the NT OSes (which is all w2k/w2k3/winxp/longhorn, obviously)...

look at the alphabet. Find the letters VMS. Then find the letters WNT (as in Windows NT).

Notice something interesting? 😛
 
But since the early 90's we have developed "Windowing Systems" where as many console windows may be spawned as you would like. Each text-mode process can live in its very own console window, eliminating the need to switch between processes in a single console! (Yay, progress!)

Have you ever used screen? I wouldn't call having each program running in it's own window progress, I would call it clutter.

Yes, try "start <process_name>". Or "help start" if you don't know how to use start. It's roughly the equivalent of unix's "nice" and "&amp;" wrapped into one, with a few extra features thrown in.

But you can't do anything with them after that, they're detached from the shell and MS is nice enough to leave out usefull things like ps and kill unless you install the Resource Kit.
 
Originally posted by: n0cmonkey
Originally posted by: kylef
I like the new MSH (Microsoft Shell) which you can read about here.

It's not fair to mention things that are not available to the rest of us.

It is available to you. Go to Microsoft Betaplace and sign up to be a "beta tester" (no obligations). Basically, you just fill out a questionaire and promise to leave feedback if you notice any bugs. When you fill out the form, tell them you're an Elitist Unix Snob and want to see what the new "Monad Shell (MSH)" can really do. 🙂 You're the exact audience they want to test it on.

And, there is a chance (not sure how big or small) that it might eventually run on any platform that supports the CLR (i.e., Mono... (i.e., Linux)). So rejoice! 😛
 
Originally posted by: Nothinman
Yes, try "start <process_name>". Or "help start" if you don't know how to use start. It's roughly the equivalent of unix's "nice" and "&amp;" wrapped into one, with a few extra features thrown in.
But you can't do anything with them after that, they're detached from the shell...
Drag asked about "Forking processes", not "Forking processes in a manner so that the new process and the old process both live within the same console." The second is a special case of the first.

And I would completely disagree with the statement that forking a process into a new shell means that "you can't do anything with them after that." Everyone running Windows has multiple consoles available (this guarantee cannot be made for Unix, which is why suspend is necessary).

When you launch something with the "start" command, your keyboard focus is immediately shifted to the new process's window (be it a console, or a GUI). You can return focus to the launching shell with precisely TWO keystrokes: Alt-Tab. (The previous window is guaranteed to be on top of the stack).

That sounds good to me: it's simple, and it's convenient for those working at the keyboard.
...and MS is nice enough to leave out usefull things like ps and kill unless you install the Resource Kit.
Installing the freely available Resource Kit is not that difficult, is it?
 
Everyone running Windows has multiple consoles available (this guarantee cannot be made for Unix, which is why suspend is necessary).

Whether it's necessary or not isn't totally relevant, the fact remains that it's usefull. I hit ctrl+z to suspend something to do quick look in the shell for a path or something all the time and what's a really nice side affect is that I can send a SIGSTOP to any process and it stops completely until I send it a SIGCONT, is there anyway to do that in Windows?

Installing the freely available Resource Kit is not that difficult, is it?

The fact that it's not difficult doesn't mean I should have to do it. Why not do the same thing for IE and OE? It wouldn't be hard to go download those seperately either, would it?
 
Originally posted by: kylef
Originally posted by: Nothinman
Yes, try "start <process_name>". Or "help start" if you don't know how to use start. It's roughly the equivalent of unix's "nice" and "&amp;" wrapped into one, with a few extra features thrown in.
But you can't do anything with them after that, they're detached from the shell...
Drag asked about "Forking processes", not "Forking processes in a manner so that the new process and the old process both live within the same console." The second is a special case of the first.

And I would completely disagree with the statement that forking a process into a new shell means that "you can't do anything with them after that." Everyone running Windows has multiple consoles available (this guarantee cannot be made for Unix, which is why suspend is necessary).

Well that's the rub isn't it? MS is assuming that everybody has multiple consoles. I have multiple consoles usually. I can even open up multiple ssh terminals. But what is wrong with having something that "just works". Why is it a requirement that I have to have a entire win32-type enviroment to run mutliple programs from my command line?

When you launch something with the "start" command, your keyboard focus is immediately shifted to the new process's window (be it a console, or a GUI). You can return focus to the launching shell with precisely TWO keystrokes: Alt-Tab. (The previous window is guaranteed to be on top of the stack).

works here, too. I use alt-tab to switch plenty of times from window to window. I also use fg and bg commands. I also use ctrl-z to move things into the background and ctrl-c to kill things. I also use ctrl-alt-n, ctrl-alt-p and various other key combos to manage mutlitple command line instances. I can devid up my terminal into halves and forths if I want to. Also I can close out my command line and resume without loss of data or anything from any ssh-client capable computer in the world, to bad X doesn't work that way, yet.

That sounds good to me: it's simple, and it's convenient for those working at the keyboard.
...and MS is nice enough to leave out usefull things like ps and kill unless you install the Resource Kit.
Installing the freely available Resource Kit is not that difficult, is it?

Well, sure, but why not have it aviable by default? Is it just to save on disk space?

You see "unix snobs" get all trite when people talk about improving or surpassing Unix thru creating stuff like command lines that are supposedly superior to Unix shells, but most of the time it totally misses the point. The command line is a entirely parrellel user interface. Unlike GUI's it can't realy be that user friendly, and syntaxs can be realy arcane and intimidating, but it's usefull and highly evolved way of dealing with computers. There still is progress, there still is active developement of all aspects of Unix, even the command line eviroment is much more sophisticed then similar enviroments that were aviable 5 years ago. It's as big as a difference from the original Mac OS gui and WinXP's GUI.

MS could install and have pdksh and bash and any other shell ported to MS Windows, and it would still suck, because the system isn't realy designed to utilize it, it lacks flexiblity. All that a command line is used for in Windows is just to run commands that are too inconvient to write guis for.

It's not like that can't change. The beta program is interesting. I'll have to dig up a w2k3 OS somewere in order to play around with it. To bad money doesn't grow on trees, eh?
 
Originally posted by: kylef
Originally posted by: n0cmonkey
Originally posted by: kylef
I like the new MSH (Microsoft Shell) which you can read about here.

It's not fair to mention things that are not available to the rest of us.

It is available to you. Go to Microsoft Betaplace and sign up to be a "beta tester" (no obligations). Basically, you just fill out a questionaire and promise to leave feedback if you notice any bugs. When you fill out the form, tell them you're an Elitist Unix Snob and want to see what the new "Monad Shell (MSH)" can really do. 🙂 You're the exact audience they want to test it on.

And, there is a chance (not sure how big or small) that it might eventually run on any platform that supports the CLR (i.e., Mono... (i.e., Linux)). So rejoice! 😛

Thanks for the link. I'll check it out later. Too lazy now. 😉

I mostly want to strings it, to see if anymore OpenBSD stuff pops up. The SFU kit seems to have a bit of it. 😉 And Microsofties seem to go on and on about how good OpenBSD is... 😀
 
Originally posted by: Nothinman
Whether it's necessary or not isn't totally relevant, the fact remains that it's usefull. I hit ctrl+z to suspend something to do quick look in the shell for a path or something all the time and what's a really nice side affect is that I can send a SIGSTOP to any process and it stops completely until I send it a SIGCONT, is there anyway to do that in Windows?
Yes, in fact you can suspend any thread on the system via Win32's SuspendThread() (you obviously need to have a security token with the THREAD_SUSPEND_RESUME privilege).

If you mean, "Can I do this at the command line?" the answer is also yes. There are some fantastically useful freeware tools available at SysInternals, and one of them is "PsTools" which has a utility called "PsSuspend", allowing you to do exactly this very thing from the command line.

(I never said MS currently includes all the useful utilities necessary to do EVERYTHING at the command-line...)

The fact that it's not difficult doesn't mean I should have to do it. Why not do the same thing for IE and OE? It wouldn't be hard to go download those seperately either, would it?
There's an obvious difference here. YOU are savvy enough to download some command-line tools. But someone wanting to use Outlook Express may not know how to download it. And without IE on the system, I can pretty much guarantee that 95% of people wouldn't have a clue how to download stuff. 🙂
 
Originally posted by: drag
Well that's the rub isn't it? MS is assuming that everybody has multiple consoles. I have multiple consoles usually. I can even open up multiple ssh terminals. But what is wrong with having something that "just works". Why is it a requirement that I have to have a entire win32-type enviroment to run mutliple programs from my command line?
Right, I agree. But what I'm saying is that it's a reasonable assumption given that you CANNOT run Windows without running the Win32 subsystem, the "Window Manager" for NT. I completely agree that it shouldn't HAVE to be that way, but for various historical reasons, it is that way. And given that it's that way, making the assumption that people can start another console is reasonable. It won't be reasonable, however, when they ditch the Window Manager. I predict that yes, it will happen eventually. And when it does, you'll see a flurry of command-line tools development to support single-console scenarios. But until that time, this is just a minor point to most people.

MS could install and have pdksh and bash and any other shell ported to MS Windows, and it would still suck, because the system isn't realy designed to utilize it, it lacks flexiblity.
The suspend/resume thing is not a platform limitation: it's a command shell limitation. You could write your own shell that intercepts Ctrl-D and swaps input/output buffers to the console with a 'fg' built-in command. As we have already established, the process creation is built into the OS and works fine, and suspending threads also works fine. These are the only OS-level primitives you need to support your shell's behavior. In fact, I'm surprised that no one has done this if it's really that important. What's the behavior of bash on Cygwin in NT? I never tried back when I ran Cygwin. It may do this already...

My point is that the *NT platform* is ultra-flexible and supports just about any configuration you can imagine (the single exception currently being that the Win32 windowing subsystem is NOT optional). Whether Microsoft packages the platform with the apps you want to see is another story entirely.

Anyway, other than the suspend/resume thing (which we have established the current Command Shell does not support), what else are you referring to that the system cannot do that bash et. al. support?
 
can I, say, install and setup MSSQL, say from a laptop in case you get stuck out in the boonies and need to do some emergancy stuff... Or install backups without having to be present to reboot the machine.

Or dozens of other things.. I dont know.

Can you start and stop services from a ssh client? Say half you dll's are wiped out.

It's not just the cmd.exe stuff I am talking about, it's the entire OS. For instance in Redhat, Solaris, or Debian every single administration thing that I can do in a GUI I can do in the command line. A configs are simple text based affairs. I mean can you edit the registry from cmd.exe if you have too? Or fix it from recorvery console or copy it to another computer, fix it their and copy it back?

Can I "trail" system logs, or e-mail people via the command line. How difficult would it be to trail a system log and have it e-mail me if it had a certian alert, or a certian person logged in? What if I had a cluster of machines operating that I had to watch over?

It's a small thing to have a bunch of xterms on one or two desktops and be able to switch between them and perform actions and copy-n-paste commands/scripts between them.

I suppose it's lots of small things. Probably not even a issue to most people, you could setup monitoring tools and things like big brother or bunches of grekllm. But it's just the convienence and speed. I mean I work for a company that has a couple hundred employees. There are two admins and they are incharge of e-mail, webservers, anything and everything to do with the network and whatnot. They have perl scripts that are setup to do things like when a person is on vacation and they get a e-mail the e-mailer gets a polite reply (only once) that the person is away. Stuff like that, they never leave their offices. The only thing they ever do in the server room is install machines, and the rest of the time the admin from a completely different part of the building.

Of course they have a couple Windows machines, and they use VNC for that, but it's a kinda of a pain for them to do anything using it compared to having something right their they can type into.

I am not talking just about the shell, but the entire OS. Windows realy isn't designed to be realy administrated from the command line.

I suppose you have terminal services and all that. And you could do, like what?, setup remote alerts or something like that from the different menus and wizards and whatnot that are part of the administration tools for w2k/w2k3.

But I just a command line type of guy. Lots of stuff that is easy for me to do on my linux machine is very difficult to accomplish. Even when I subscribed for a little while to a online FreeBSD shell server, and all they had was (bleh) csh, with no real tab completetion, I was still able to surf around, download stuff, install programs, setup a website, edit programs, run port scans (on my own home lan), and stuff like that was a no brainer. And there were dozens of other people on the servers doing the same things I was. Going from computer to computer was a seemless affair(mind you this computer was nearly a quarter of the world away). Copying stuff, rsyncing the website with the backups at home. All sorts of stuff.

The Windows enviroment isn't realy designed to be used like that. You say, it's progress and to get with the 21st century and all that, but from my perpective it simply means that the command line enviroment for Windows just plain sucks. If I was using a Windows machine, I probably wouldn't ever touch it except to check on networking interfaces and stuff like that. Maybe a batch file or two. Maybe just use cygwin or something like that. (hell, you don't even have a SSH server avaible that doesn't cost a arm and a leg or doesn't require something like cygwin, still relying on telnet! Or something...)
 
Originally posted by: kylef
There's an obvious difference here. YOU are savvy enough to download some command-line tools. But someone wanting to use Outlook Express may not know how to download it. And without IE on the system, I can pretty much guarantee that 95% of people wouldn't have a clue how to download stuff. 🙂

Slightly OT, but how many of you remember boot-strapping a freshly-installed Windows OS, and having to use the command-line FTP.EXE bundled with MS's TCP/IP stack to go to ftp.microsoft.com to download IE?
Thank goodness, when all else fails, there is the command-line to fall back on, eh?
 
Nope, but I remember booting up with a dos disk with netbuie support (after downloading and configuring the autoexec type stuff to use the drivers for my 3com 10mbit ethernet cards), copying over a windows directory with a bunch of cab files and a command called setup.exe and installing windows 9x machines that way.

Beats the hell out of trying to install from a dozens of floppy drivers, or buying a bunch of cdrom drives with money I didn't have.
 
Back
Top