DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Building Scalable Real-Time Apps with AstraDB and Vaadin
Register Now

Trending

  • Comparing Cloud Hosting vs. Self Hosting
  • Introduction To Git
  • Micro Frontends on Monorepo With Remote State Management
  • Integration Architecture Guiding Principles, A Reference

Trending

  • Comparing Cloud Hosting vs. Self Hosting
  • Introduction To Git
  • Micro Frontends on Monorepo With Remote State Management
  • Integration Architecture Guiding Principles, A Reference
  1. DZone
  2. Data Engineering
  3. Databases
  4. A Better way to Access Swift From the Terminal

A Better way to Access Swift From the Terminal

Michael Crump user avatar by
Michael Crump
·
Aug. 01, 14 · Interview
Like (0)
Save
Tweet
Share
7.05K Views

Join the DZone community and get the full member experience.

Join For Free

A Better Way to Access Swift From the Terminal

Introduction

In my original post, I described how to create an alias to run Swift from the terminal. The only problem was when the user closed the terminal window, they would have to run the 'alias' command again. In this short tutorial, we are going to setup a way that the alias "sticks" between terminal sessions.

Open the Terminal Window Again

Enter the follow command to open your .bash_profile in TextEdit:

touch ~/.bash_profile; open ~/.bash_profile

Enter the following command in TextEdit changing only the Xcode6-BetaXX number (for whichever version of the beta you are using):

alias swift="/Applications/Xcode6-Beta4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift"

Save the File by pressing CMD+S and quit TextEdit by pressing CMD-Q.

Return to the terminal window and type:

source ~/.bash_profile

This will load the bash file without having to reboot.

Now if you simply type swift then you can access the Swift REPL.

After a Reboot

Simply type swift from the terminal without having to set the alias again since it was loaded during startup in your .bash_profile.

terminal Swift (programming language)

Published at DZone with permission of Michael Crump. See the original article here.

Opinions expressed by DZone contributors are their own.

Trending

  • Comparing Cloud Hosting vs. Self Hosting
  • Introduction To Git
  • Micro Frontends on Monorepo With Remote State Management
  • Integration Architecture Guiding Principles, A Reference

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: