Home Forums Chat Forum Bash on Windows?!

Viewing 29 posts - 1 through 29 (of 29 total)
  • Bash on Windows?!
  • chambord
    Full Member

    Anyone else excited about the news coming out of Build 2016? I know Cygwin’s been around forever but Microsoft partnering with Canonical like this is massive – it would have been unthinkable a couple of years ago. Feels like they’re turning a corner and I’m looking forward to seeing how it goes.

    Cougar
    Full Member

    Ooh. I hadn’t heard about that. Interesting.

    allthepies
    Free Member

    Only 20 years too late 🙂

    footflaps
    Full Member

    Just cut out the middle man and instal Linux on a PC!

    MSP
    Full Member

    It would be even better if linux would adopt powershell.

    TheBrick
    Free Member

    That would be good. I was just bemoaning windows poor command line interface today. But will it include many of the utilities that make bash so powerful, from little ones like less through to find and grep all the way to sed and awk?

    BigEaredBiker
    Free Member

    This is going to be quite useful, in theory if I understand correctly you should be able to install most software from Ubuntu’s repositories. Now being able to run it all…

    Cougar
    Full Member

    It would be even better if linux would adopt powershell.

    Never happen. The whole point of PS is that it’s tightly integrated into the OS, it’d need a massive rewrite of the whole repositories to even approach the functionality of PS in Windows.

    As an example; if you use the Exchange administration GUI, it’s all Powershell under the hood. Clicking tickboxes generates PS scripts which fire when you Apply. You can do absolutely everything, and more, via PS than you can with the GUI panel. And that’s true across the OS, the Linux model just isn’t built for that sort of standardisation. Linux’s biggest strength is actually its biggest weakness here.

    grep

    “find” is the same thing, more or less.

    footflaps
    Full Member

    “find” is the same thing, more or less.

    You can’t be serious – grep is just vast in it’s options etc and very very fast….

    sirromj
    Full Member

    Use Cygwin a bit and always wondered why it was so slow in comparison. Saw someone claiming it due to Windows not being able to fork processes as readily as *nix. Will be good if they’ve solved that one. .

    chvck
    Free Member

    Sounds like good news, I personally prefer git bash over cygwin though. Although git bash is missing a few things.

    Cougar
    Full Member

    You can’t be serious – grep is just vast in it’s options etc and very very fast….

    Find is crap in its options but equally fast. Point was, I was trying to be helpful rather than ‘yay Windows.’

    As a Windows command line junkie, I also despair at its limitations that date back to MS-DOS (errorlevel, really?); PS is incredibly powerful but still lacks the tools Linux has out of the box (unless I’ve just not found them yet).

    Cougar
    Full Member

    Use Cygwin a bit and always wondered why it was so slow in comparison

    Isn’t Cygwin essentially an emulator?

    chvck
    Free Member

    Not bash, but this may be of interest to some https://chocolatey.org/%5B/url%5D

    footflaps
    Full Member

    The main strength of bash is piping commands into each other e.g.

    grep | sed | cut | grep | sed etc

    Pretty sure windows has no equivalent functionality.

    sirromj
    Full Member

    which find

    footflaps
    Full Member

    So Cougar he’s a genuine query – I synced my iPhone to my macbook using Picasa and noticed that it had created loads of subfolders, so all my photos were in 100s of folders. Anyway, as MacOSX is BSD, moving everything to one folder was trivial

    mv */*.jpg .

    Which moves all ‘,jpg’s in every sub folder of the current directory to the current directory.

    How would I do this in Windows / PS?

    Cougar
    Full Member

    a genuine query

    It’s not nearly as clean and simple, but you can do it. You’d have to recurse through the directories.

    This is off the top of my head and in no way expected to work, but it’d be something like:

    FOR /R c:\path %%G IN (*.jpg) DO move "%%G" .

    …ish.

    The main strength of bash is piping commands into each other

    You can do that in Windows, it’s even the same symbol.

    Say I want to find all static routes which contain “192” (rubbish example but the first thing I thought of).

    route print | find "192"

    Whether you can chain multiples together I don’t know.

    sirromj
    Full Member

    Try this in Windows:

    echo more | more | more > more && type more
    del more || echo no more
    del more || echo no more

    And this in bash:

    echo more | more | more > more && cat more
    rm more || echo no more
    rm more || echo no more

    chambord
    Full Member

    Not bash, but this may be of interest to some https://chocolatey.org/

    That is of interest. Thanks a lot

    Archibald
    Free Member

    Good answers on this question from one of the creators of powershell

    http://stackoverflow.com/questions/573623/is-powershell-ready-to-replace-my-cygwin-shell-on-windows

    scaled
    Free Member

    this should do it:
    gci -Recurse *.jpg | foreach {Move-Item -Path $_.FullName -Destination .\}

    WMF/Powershell 5 is a bit of a game changer, I’ve been dicking about with DSC for a couple of weeks now and it’s crazy good.

    I’m pulling nuget packages straight out of my artifactory and pushing them with all the prereqs like rabbit/mongo out to vanilla servers. If you integrate it with the Azure DSC modules then you can bring full on elastic scaling to a hybrid cloud.

    It’s cracking for continuous integration and deployment as you can push the builds straight out to the test servers.

    2 weeks ago i’d never heard of nuget or DSC so it’s been a bit of a learning curve.

    Cougar
    Full Member

    DSC?

    scaled
    Free Member

    Desired state configuration.

    You can basically decouple the server (node) config from your deployment scripts.

    It goes off and creates a couple of (MOF) files which are then pushed out to the servers and they then apply the config to themselves.

    The trick bit is that you can host a pull server which is just a web service the all the servers poll for updates periodically. If there’s a change to their declarative config then they’ll apply that but also, if they’ve drifted from the defined config they’ll pull themselves back in line.

    scaled
    Free Member

    Only issue i’ve found so far is that the local config manager on the servers you’re configuring runs under the system account so if you’re accessing anything on a network share you need to provide a credential to connect to it so you need to encrypt the MOF files with the certificate of the server and specify the public key in the node config which was a bit of a faff.

    Using symbol source as the artifact store has solved that to a degree. Thankfully i’m working on a new project that’s being run properly. My efforts to back port it to an existing product is proving rather painful as there’s multiple source control systems and the DSC package resource is still pretty fresh o older exe installers aren’t really supported.

    allthegear
    Free Member

    One of the first things in my Mac rebuild script is to replace bash with zsh and oh-my-zsh

    Rachel

    scaredypants
    Full Member

    I’m pulling nuget packages straight out of my artifactory and pushing them with all the prereqs like rabbit/mongo out to vanilla servers. If you integrate it with the Azure DSC modules then you can bring full on elastic scaling to a hybrid cloud.

    HOUSE!!!!

    (I take it bash is something computery then? I assumed this was some sort of game 😳 )

    chambord
    Full Member

    There is an in depth video here. I’m so excited about this, probably more than I should be. I’m a linux user at heart but a Windows developer for work. This will give me all the niceties of the linux command line and all the developer tools from Windows – nice!

    One of the first things in my Mac rebuild script is to replace bash with zsh and oh-my-zsh

    apt-get install zsh

    Done.

Viewing 29 posts - 1 through 29 (of 29 total)

The topic ‘Bash on Windows?!’ is closed to new replies.