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

  • Home
  • SEARCH
  • 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 8822663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:09:41+00:00 2026-06-14T06:09:41+00:00

Does anybody know why this works with bash calculator ( bc ) in vim

  • 0

Does anybody know why this works with bash calculator (bc) in vim:

echo system ("echo 3+5 \| dos2unix \| bc -l") ---> output: 8   
echo system ("echo 3/5 \| dos2unix \| bc -l") ---> output: .600000000000000  
echo system ("echo 3*5 \| dos2unix \| bc -l") ---> output: 15   

but this not:

echo system ("echo 2^5 \| dos2unix \| bc -l") ---> output: 25  
echo system ("echo 3^5 \| dos2unix \| bc -l") ---> output: 35  

This is used under cygwin in Windows.

  • 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-06-14T06:09:42+00:00Added an answer on June 14, 2026 at 6:09 am

    What is the value of &shell option? It must be /path/to/cygwin/bash, not something ending with cmd.exe. The problem is that ^ is an escape character in windows cmd.exe, so echo 2^5 is somewhat equivalent to echo 2\5 resolving into echo 25.

    If it is cmd.exe add a line

    set shell=/path/to/cygwin/bash
    

    to your vimrc.

    Note though that echo 2^^^^5 resolving to echo 2^5 is somewhat strange (in plain cmd.exe it is echo 2^^5), but I saw very long discussion on vim-dev regarding escaping issues for cmd.exe some time ago, so it may be one of them. Should not happen on the most recent vim (or it is a bug).

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

Sidebar

Related Questions

Does anybody know why this url works fine on a desktop browser (Safari) but
Does anybody know why the same code from this page http://emacsformacosx.com/ would not render
In Oracle, this returns 03/01/2010. That does not make sense to me. Anybody know
Does anybody know why this slider works well in every browser except for safari
Does anybody know why this function, when passed an invalid date (e.g. timestamp) to
Does anybody know why I get this warning when I turn off the auto-commit
Does anybody know how to do this syntax below in mysql? Without Stored Procedure,
Does anybody know how to programmatically disable the keyboard individual letter pop-up? (This blue
Does anybody know whether one exists? I've been googling this for monthes... Thanks
I found some information about this on Scott Hanselmans Blog Does anybody exactly know

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.