Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6673261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:36:24+00:00 2026-05-26T03:36:24+00:00

In response to a previous question, Alternatives to system() in R for calling sed,

  • 0

In response to a previous question, Alternatives to system() in R for calling sed, rsync, ssh etc.: Do functions exist, should I write my own, or am I missing the point?, hadley’s answer indicated that when faced with a similar problem, he had used a function like:

bash <- function() system("bash")

I found the original in his devtools package; implemented in devtools/R/bash.R:

#' Open bash shell in package directory.
#'
#' @param pkg package description, can be path or package name.  See
#'   \code{\link{as.package}} for more information
#' @export
bash <- function(pkg = NULL) {
  pkg <- as.package(pkg)

  in_dir(pkg$path, system("bash"))
}


I don’t understand the point of this. When I issue

bash <- function() system("bash")

It sends me to the bash shell, after which exit returns me to the R session, but there is no bash function. It seems that I can get the same effect by either issuing either of the following command pairs (first command in R, second in bash)

system('bash')
exit

or

q('yes')
R


the striked part were due to a copy/paste error on my part

I also can not find any further uses of the bash function in the devtools package

Can someone please help me understand how the bash function could be used; can it be used in contexts (e.g. within scripts or functions) other than interactive R mode?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:36:25+00:00Added an answer on May 26, 2026 at 3:36 am

    Earlier versions of devtools included some functionality to push/pull code to git/github. This has now been deprecated.

    Instead, the convenience function bash simply opens a bash editor in the package directory. This means you can use command line tools to interact with git/github.

    The purpose of bash is simply to save a few keystrokes to open the command line in the package directory. It serves no other function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Reference to previous question: Getting an ajax response in java from a web method
In @mmalc's response to this question he states that In general you should not
In response to a previous question, I received this helpful answer : for (var
This is in response to my previous question: PowerShell: -replace, regex and ($) dollar
So thanks to the response to my previous question , I've tried to make
In response to a previous question , @Pablo Fernandez suggested I implement a simple
As a response to my previous question, I think I may have discovered which
Based on the response to this question: Why does C++ have header files and
Following on from my previous question, I am getting another compilation error on my
This is an attempt to rephrase my previous question as a result of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.