SlideShare una empresa de Scribd logo
1 de 11
Descargar para leer sin conexión
Onorio Catenacci
Shell Scripting With F#
CodeStock is proudly partnered with:




                RecruitWise and Staff with Excellence - www.recruitwise.jobs


      Send instant feedback on this session via Twitter:
        Send a direct message with the room number to @CodeStock
        d codestock 401 This session is great!

      For more information on sending feedback using Twitter while at
      CodeStock, please see the “CodeStock README” in your CodeStock guide.
what we do
 consulting       training     design      debugging

who we are
 Founded by top experts on Microsoft – Jeffrey Richter, Jeff Prosise, and John Robbins – our
 mission is to help our customers achieve their goals through advanced software-based
 consulting and training solutions.

how we do it                                               Training
                                                           •   On-site instructor-led training
 Consulting & Debugging                                    •   Virtual instructor-led training
 •   Architecture, analysis, and design services           •   Devscovery conferences
 •   Full lifecycle custom software development
 •   Content creation                                      Design
 •   Project management                                    •   User Experience Design
 •   Debugging & performance tuning                        •   Visual & Content Design
                                                           •   Video & Animation Production


                                                                                      wintellect.com
• What We’ll Discuss
                            – Important Background
Shell Scripting With F#

                            – Use cases
                            – Code
                            – Additional resources
• Important Background
                            – Shell Scripting
                              • Want It Lightweight
Shell Scripting With F#


                                 – Rapid testing/prototyping
                                 – REPL
                              • Often driving apps via command-line
                              • Want One Language For All
                              • Shell Scripting Languages
                                 –   Cmd
                                 –   VBScript
                                 –   Powershell
                                 –   Bash
• Important Background
                            – Functional Programming
                                Immutable data by default (ex. 1, 2)
Shell Scripting With F#

                              •
                              • Lambda functions (ex. 3)
                              • Functions are “first class” (ex. 4,5,6)
                              • Currying/partial application vs. tupled
                                parameters (ex. 7,8, 9)
                              • Unit type (ex. 10)
                              • All functions return a value
• Important Background
                            – F#
                              • ML language family
Shell Scripting With F#


                                   – Standard ML
                                   – OCaml
                              •   Indentation sensitive by default
                              •   Types of values are inferred from usage
                              •   Some/None
                              •   |> (Pipe Forward)
                              •   All funcs must be declared before use
• Why Write A Shell Script?
                            – Wrap functionality which you can’t
                              change
Shell Scripting With F#


                            – Automate common operations
                            – Large batch jobs
• Why Use F# For Shell Scripting?
                            – One language which scales
Shell Scripting With F#

                            – Low ceremony
                              • Type inference
                            – Default immutability
                            – Good way to practice FP
                            – Free to choose your own for shell
                              scripting
• Code
                            – Command Line
                              • "C:Program Files (x86)Microsoft
Shell Scripting With F#


                                F#v4.0Fsi.exe" --exec <name of .fsx>
                                <args>
                              • Args are passed as array of strings
                              • args.[0] is name of script; actual args start at
                                args.[1]
                              • Last line of fsx invokes main func and
                                passes commandline args:
                                   – main fsi.CommandLineArgs;;
• Additional Resources
                            – Chris Smith’s “Scripting In F#”
Shell Scripting With F#

                              • http://blogs.msdn.com/b/chrsmith/archive/2008/09/
                                12/scripting-in-f.aspx
                            – Programming F# 3.0
                              • Chapter on F# Shell Scripting and Common Idioms
                            – Fake (F# Make Files) (Steffen Forkmann)
                              • https://github.com/forki/FAKE
                            – Finnikin (F# Shell Scripting Utility
                              Library)
                              • https://github.com/OnorioCatenacci/finnikin

Más contenido relacionado

La actualidad más candente

Test-driven language development
Test-driven language developmentTest-driven language development
Test-driven language developmentlennartkats
 
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel ZikmundKarel Zikmund
 
Programming Language Selection
Programming Language SelectionProgramming Language Selection
Programming Language SelectionDhananjay Nene
 
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel ZikmundKarel Zikmund
 
PIL - A Platform Independent Language
PIL - A Platform Independent LanguagePIL - A Platform Independent Language
PIL - A Platform Independent Languagezefhemel
 
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
.NET MeetUp Prague 2017 - .NET Standard -- Karel ZikmundKarel Zikmund
 
Remix Your Language Tooling (JSConf.eu 2012)
Remix Your Language Tooling (JSConf.eu 2012)Remix Your Language Tooling (JSConf.eu 2012)
Remix Your Language Tooling (JSConf.eu 2012)lennartkats
 
Integrated Language Definition Testing: Enabling Test-Driven Language Develop...
Integrated Language Definition Testing: Enabling Test-Driven Language Develop...Integrated Language Definition Testing: Enabling Test-Driven Language Develop...
Integrated Language Definition Testing: Enabling Test-Driven Language Develop...lennartkats
 
Enlightenment: A Cross Platform Window Manager & Toolkit
Enlightenment: A Cross Platform Window Manager & ToolkitEnlightenment: A Cross Platform Window Manager & Toolkit
Enlightenment: A Cross Platform Window Manager & ToolkitSamsung Open Source Group
 
COMPUTER LANGUAGES AND THERE DIFFERENCE
COMPUTER LANGUAGES AND THERE DIFFERENCE COMPUTER LANGUAGES AND THERE DIFFERENCE
COMPUTER LANGUAGES AND THERE DIFFERENCE Pavan Kalyan
 
The Future of Cross-Platform is Native
The Future of Cross-Platform is NativeThe Future of Cross-Platform is Native
The Future of Cross-Platform is NativeJustin Mancinelli
 
Week 8 intro to python
Week 8   intro to pythonWeek 8   intro to python
Week 8 intro to pythonbrianjihoonlee
 
Extending ZF & Extending With ZF
Extending ZF & Extending With ZFExtending ZF & Extending With ZF
Extending ZF & Extending With ZFRalph Schindler
 
DSL Construction rith Ruby
DSL Construction rith RubyDSL Construction rith Ruby
DSL Construction rith RubyThoughtWorks
 
Velocity-EHF for Android
Velocity-EHF for AndroidVelocity-EHF for Android
Velocity-EHF for Androidmichaeljfawcett
 

La actualidad más candente (19)

Test-driven language development
Test-driven language developmentTest-driven language development
Test-driven language development
 
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
 
Programming Language Selection
Programming Language SelectionProgramming Language Selection
Programming Language Selection
 
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
 
PIL - A Platform Independent Language
PIL - A Platform Independent LanguagePIL - A Platform Independent Language
PIL - A Platform Independent Language
 
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
 
Remix Your Language Tooling (JSConf.eu 2012)
Remix Your Language Tooling (JSConf.eu 2012)Remix Your Language Tooling (JSConf.eu 2012)
Remix Your Language Tooling (JSConf.eu 2012)
 
201811xx foredrag c_cpp
201811xx foredrag c_cpp201811xx foredrag c_cpp
201811xx foredrag c_cpp
 
Integrated Language Definition Testing: Enabling Test-Driven Language Develop...
Integrated Language Definition Testing: Enabling Test-Driven Language Develop...Integrated Language Definition Testing: Enabling Test-Driven Language Develop...
Integrated Language Definition Testing: Enabling Test-Driven Language Develop...
 
P1 2017 python
P1 2017 pythonP1 2017 python
P1 2017 python
 
P1 2018 python
P1 2018 pythonP1 2018 python
P1 2018 python
 
Enlightenment: A Cross Platform Window Manager & Toolkit
Enlightenment: A Cross Platform Window Manager & ToolkitEnlightenment: A Cross Platform Window Manager & Toolkit
Enlightenment: A Cross Platform Window Manager & Toolkit
 
COMPUTER LANGUAGES AND THERE DIFFERENCE
COMPUTER LANGUAGES AND THERE DIFFERENCE COMPUTER LANGUAGES AND THERE DIFFERENCE
COMPUTER LANGUAGES AND THERE DIFFERENCE
 
The Future of Cross-Platform is Native
The Future of Cross-Platform is NativeThe Future of Cross-Platform is Native
The Future of Cross-Platform is Native
 
Week 8 intro to python
Week 8   intro to pythonWeek 8   intro to python
Week 8 intro to python
 
Ndk
NdkNdk
Ndk
 
Extending ZF & Extending With ZF
Extending ZF & Extending With ZFExtending ZF & Extending With ZF
Extending ZF & Extending With ZF
 
DSL Construction rith Ruby
DSL Construction rith RubyDSL Construction rith Ruby
DSL Construction rith Ruby
 
Velocity-EHF for Android
Velocity-EHF for AndroidVelocity-EHF for Android
Velocity-EHF for Android
 

Similar a Shell scripting with f

Porting E-poetry: The Case of First Screening
Porting E-poetry: The Case of First ScreeningPorting E-poetry: The Case of First Screening
Porting E-poetry: The Case of First ScreeningLeonardo Flores
 
Overview new programming languages
Overview new programming languagesOverview new programming languages
Overview new programming languagesumoren
 
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel ZikmundKarel Zikmund
 
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel ZikmundKarel Zikmund
 
2016 bioinformatics i_python_part_1_wim_vancriekinge
2016 bioinformatics i_python_part_1_wim_vancriekinge2016 bioinformatics i_python_part_1_wim_vancriekinge
2016 bioinformatics i_python_part_1_wim_vancriekingeProf. Wim Van Criekinge
 
The Architect Way - JSCamp.asia 2012
The Architect Way - JSCamp.asia 2012The Architect Way - JSCamp.asia 2012
The Architect Way - JSCamp.asia 2012Jan Jongboom
 
Modified.net overview
Modified.net overviewModified.net overview
Modified.net overviewFaisal Aziz
 
Erlang - Concurrent Language for Concurrent World
Erlang - Concurrent Language for Concurrent WorldErlang - Concurrent Language for Concurrent World
Erlang - Concurrent Language for Concurrent WorldZvi Avraham
 
Shell scrpting(payal harne)
Shell scrpting(payal harne)Shell scrpting(payal harne)
Shell scrpting(payal harne)PayalHarne
 
Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...
Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...
Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...Charles Beyer
 

Similar a Shell scripting with f (20)

Evalution about programming language part 1
Evalution about programming language part 1Evalution about programming language part 1
Evalution about programming language part 1
 
Porting E-poetry: The Case of First Screening
Porting E-poetry: The Case of First ScreeningPorting E-poetry: The Case of First Screening
Porting E-poetry: The Case of First Screening
 
Overview new programming languages
Overview new programming languagesOverview new programming languages
Overview new programming languages
 
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
 
Bioinformatica p1-perl-introduction
Bioinformatica p1-perl-introductionBioinformatica p1-perl-introduction
Bioinformatica p1-perl-introduction
 
Intro
IntroIntro
Intro
 
Intro
IntroIntro
Intro
 
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
 
2016 bioinformatics i_python_part_1_wim_vancriekinge
2016 bioinformatics i_python_part_1_wim_vancriekinge2016 bioinformatics i_python_part_1_wim_vancriekinge
2016 bioinformatics i_python_part_1_wim_vancriekinge
 
The Architect Way - JSCamp.asia 2012
The Architect Way - JSCamp.asia 2012The Architect Way - JSCamp.asia 2012
The Architect Way - JSCamp.asia 2012
 
C# Fundamental
C# FundamentalC# Fundamental
C# Fundamental
 
Modified.net overview
Modified.net overviewModified.net overview
Modified.net overview
 
Erlang - Concurrent Language for Concurrent World
Erlang - Concurrent Language for Concurrent WorldErlang - Concurrent Language for Concurrent World
Erlang - Concurrent Language for Concurrent World
 
Shell scrpting(payal harne)
Shell scrpting(payal harne)Shell scrpting(payal harne)
Shell scrpting(payal harne)
 
Apache Drill (ver. 0.2)
Apache Drill (ver. 0.2)Apache Drill (ver. 0.2)
Apache Drill (ver. 0.2)
 
Ruby and Security
Ruby and SecurityRuby and Security
Ruby and Security
 
Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...
Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...
Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...
 
.NET - The Current Spectrum
.NET -  The Current Spectrum.NET -  The Current Spectrum
.NET - The Current Spectrum
 
Php
PhpPhp
Php
 
Php
PhpPhp
Php
 

Más de OnorioCatenacci

Basics Of Elixir and Phoenix
Basics Of Elixir and Phoenix Basics Of Elixir and Phoenix
Basics Of Elixir and Phoenix OnorioCatenacci
 
Gentle Introduction To Funcitonal Programming - Detroit.Code
Gentle Introduction To Funcitonal Programming - Detroit.CodeGentle Introduction To Funcitonal Programming - Detroit.Code
Gentle Introduction To Funcitonal Programming - Detroit.CodeOnorioCatenacci
 
Building An Elixir Package
Building An Elixir PackageBuilding An Elixir Package
Building An Elixir PackageOnorioCatenacci
 
Alternate languages for the CLR
Alternate languages for the CLRAlternate languages for the CLR
Alternate languages for the CLROnorioCatenacci
 
A RESTful Interface for Erlang Code using Webmachine
A RESTful Interface for Erlang Code using WebmachineA RESTful Interface for Erlang Code using Webmachine
A RESTful Interface for Erlang Code using WebmachineOnorioCatenacci
 

Más de OnorioCatenacci (6)

Basics Of Elixir and Phoenix
Basics Of Elixir and Phoenix Basics Of Elixir and Phoenix
Basics Of Elixir and Phoenix
 
Gentle Introduction To Funcitonal Programming - Detroit.Code
Gentle Introduction To Funcitonal Programming - Detroit.CodeGentle Introduction To Funcitonal Programming - Detroit.Code
Gentle Introduction To Funcitonal Programming - Detroit.Code
 
Building An Elixir Package
Building An Elixir PackageBuilding An Elixir Package
Building An Elixir Package
 
Alternate languages for the CLR
Alternate languages for the CLRAlternate languages for the CLR
Alternate languages for the CLR
 
A RESTful Interface for Erlang Code using Webmachine
A RESTful Interface for Erlang Code using WebmachineA RESTful Interface for Erlang Code using Webmachine
A RESTful Interface for Erlang Code using Webmachine
 
A Sip Of Elixir
A Sip Of ElixirA Sip Of Elixir
A Sip Of Elixir
 

Último

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 

Último (20)

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 

Shell scripting with f

  • 2. CodeStock is proudly partnered with: RecruitWise and Staff with Excellence - www.recruitwise.jobs Send instant feedback on this session via Twitter: Send a direct message with the room number to @CodeStock d codestock 401 This session is great! For more information on sending feedback using Twitter while at CodeStock, please see the “CodeStock README” in your CodeStock guide.
  • 3. what we do consulting training design debugging who we are Founded by top experts on Microsoft – Jeffrey Richter, Jeff Prosise, and John Robbins – our mission is to help our customers achieve their goals through advanced software-based consulting and training solutions. how we do it Training • On-site instructor-led training Consulting & Debugging • Virtual instructor-led training • Architecture, analysis, and design services • Devscovery conferences • Full lifecycle custom software development • Content creation Design • Project management • User Experience Design • Debugging & performance tuning • Visual & Content Design • Video & Animation Production wintellect.com
  • 4. • What We’ll Discuss – Important Background Shell Scripting With F# – Use cases – Code – Additional resources
  • 5. • Important Background – Shell Scripting • Want It Lightweight Shell Scripting With F# – Rapid testing/prototyping – REPL • Often driving apps via command-line • Want One Language For All • Shell Scripting Languages – Cmd – VBScript – Powershell – Bash
  • 6. • Important Background – Functional Programming Immutable data by default (ex. 1, 2) Shell Scripting With F# • • Lambda functions (ex. 3) • Functions are “first class” (ex. 4,5,6) • Currying/partial application vs. tupled parameters (ex. 7,8, 9) • Unit type (ex. 10) • All functions return a value
  • 7. • Important Background – F# • ML language family Shell Scripting With F# – Standard ML – OCaml • Indentation sensitive by default • Types of values are inferred from usage • Some/None • |> (Pipe Forward) • All funcs must be declared before use
  • 8. • Why Write A Shell Script? – Wrap functionality which you can’t change Shell Scripting With F# – Automate common operations – Large batch jobs
  • 9. • Why Use F# For Shell Scripting? – One language which scales Shell Scripting With F# – Low ceremony • Type inference – Default immutability – Good way to practice FP – Free to choose your own for shell scripting
  • 10. • Code – Command Line • "C:Program Files (x86)Microsoft Shell Scripting With F# F#v4.0Fsi.exe" --exec <name of .fsx> <args> • Args are passed as array of strings • args.[0] is name of script; actual args start at args.[1] • Last line of fsx invokes main func and passes commandline args: – main fsi.CommandLineArgs;;
  • 11. • Additional Resources – Chris Smith’s “Scripting In F#” Shell Scripting With F# • http://blogs.msdn.com/b/chrsmith/archive/2008/09/ 12/scripting-in-f.aspx – Programming F# 3.0 • Chapter on F# Shell Scripting and Common Idioms – Fake (F# Make Files) (Steffen Forkmann) • https://github.com/forki/FAKE – Finnikin (F# Shell Scripting Utility Library) • https://github.com/OnorioCatenacci/finnikin