Posted on 01/12/2018 6:11:41 AM PST by dayglored
There are a lot of Unix/Lunix scripting tools out in the wild. Microsoft is trying to bring some sanity to the world.
Am I missing something?
To me, “scripting” is the enemy of security of PC’s.
I’ve long been a heavy Linux user. Since 1994.
I’m no fan of MS’s swiss cheese of operating systems. (not because they can’t secure them, but they won’t. For their own reasons)
Apple has had a very good yet little used power shell built into its OS for years its call Apple Script.
Apple has always been a stable operating system. It’s roots are in FreeBSD.
I’m about due an upgrade on this system and a new install. It will be some form of Linux or possibly OpenBSD.
Currently running Debian and XFCE.
Uhhh--No.
Scripting is just a way to automate tasks. No more. No less.
I love XFCE. My OS is Fedora, though. I never even install Gnome or KDE.
Sanity? I'd call it hegemony. If they'd simply port the commands to Linux, bash would be all we'd need. You can pretty much do anything with Bash.
Here's a bash script that will play a round of Bunco...
#!/bin/bash rolldie() { local result=$1 rolled=$(( ( $RANDOM % 6 ) + 1 )) eval $result=$rolled } BuncoRound() { # roll, display, and score a round of bunco! # round is specified when invoked, score added to totalscore local score=0 ; local round=$1 ; local hidescore=0 rolldie die1 ; rolldie die2 ; rolldie die3 echo Round $round. You rolled: $die1 $die2 $die3 if [ $die1 -eq $die2 ] && [ $die2 -eq $die3 ] ; then if [ $die1 -eq $round ] ; then echo " BUNCO! You score 21!" score=21 hidescore=1 else echo " Mini Bunco! You score 5!" score=5 hidescore=1 fi else if [ $die1 -eq $round ] ; then score=1 fi if [ $die2 -eq $round ] ; then score=$(( $score + 1 )) fi if [ $die3 -eq $round ] ; then score=$(( $score + 1 )) fi fi if [ $hidescore -eq 0 ] ; then echo " score this round: $score" fi totalscore=$(( $totalscore + $score )) } for round in {1..6} ; do BuncoRound $round done echo "Total Score: $totalscore"
For example:
$ bunco Round 1. You rolled: 2 4 1 score this round: 1 Round 2. You rolled: 6 1 6 score this round: 0 Round 3. You rolled: 2 3 2 score this round: 1 Round 4. You rolled: 4 1 5 score this round: 1 Round 5. You rolled: 3 3 3 Mini Bunco! You score 5! Round 6. You rolled: 1 5 3 score this round: 0 Total Score: 8
I started using XFCE when Redhat 5 came out. It was not part of the package, but I was so disappointed with the bloat at the time that I looked for something lighter. Downloaded XFCE and installed it. Never looked back.
There are other very light GUI’s but XFCE is Gnome compliant and works for me.
“scripting”
OK, Thanks.
I have increased the productivity of my entire team using just bash and expect. In the range of several hundred percent. I've written scripts that have reduced our time on task from several days down to 15 minutes. As a result, we get a lot more done with a LOT less worries/frustration/stress in our jobs.
No problem. I understand that the term can be misunderstood due to the media hype surrounding people who can use the concept.
I use No Script on my browser, it has made life better for me.
It did educate me about how many scripts are running on prominent websites. Headshake.
No wonder it seem like the browser stops when you go to one of them.
That is why I use it as well--it works for me, and I don't have to adjust my work methods/styles to work within it.
Not to bash Bash but PowerShell let’s you access just about the all of the .Net functionality directly without having a bunch of little quirky little utilities.
Yeah--NoScript and an ad blocker make the Net usable.
Apple Script is the most godawful thing second only to iTunes.
True and valid point. how dotNet libraries are invoked is often absurdly baroque but usually PowerShell can handle invoking with the correct types. In fact if the library is complete the types can be imported into PS with just a reference. However when you get down to that level you might as well be programming in C#.
One has to be careful not to abuse this too much. For example I once wrote some amusing PS code for generating C# code based on parameters and creating a signed assembly to then stuff into SQL Server directly for use as a function called by scripts invoked in a distributed environment. This was a performance optimization for scrubbing multi-billion row tables in a live system, IIRC. My excuse? it was a death march. Amusingly I also invoked the SAS motto to help characterize the rationale for the risk acceptance meeting..."who dares, wins".
Disclaimer: Opinions posted on Free Republic are those of the individual posters and do not necessarily represent the opinion of Free Republic or its management. All materials posted herein are protected by copyright law and the exemption for fair use of copyrighted works.