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 "&" 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>&1 /dev/null
then
echo $i
fi
if file $i | grep audio 2>&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>&1 /dev/null &
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 &
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.