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 8667413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:57:27+00:00 2026-06-12T17:57:27+00:00

I am using R a lot. In R, you can call a man page

  • 0

I am using R a lot. In R, you can call a man page for a function by writing

?print

I got used to that so much that I intermittently type that in a bash shell window as well. Now, I have set up an alias

?='man'

that almost cuts it: I can do, for example, ? ls. However, I would prefer it to work with ?ls. Unfortunately, this one does not work. Is there any way to make bash call the man page when I type the question mark without the space after?

  • 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-12T17:57:29+00:00Added an answer on June 12, 2026 at 5:57 pm

    bash provides a hook for handling undefined commands. Since you are unlikely to ever have any commands whose names start with ?, you can use this hook to process any attempt to run such a command:

    command_not_found_handle () {
        if [[ $1 =~ ^\? ]]; then
            cmd=${1#\?}
            man $cmd
        else
            echo "$1: command not found" >&2
            return 127
        fi
    }
    

    This function would go into your .bashrc file, so that is it available in any shell. When you try to execute

    $ ?ls
    

    the command is not found, the hook intercepts the failed attempt to find the command, determines that the command name starts with ?, then strips the ? and passes the result as an argument to man. Other undefined commands merely produce an error message similar to the default bash error for unfound commands and exits with status 127 (the same status bash usually uses to denote command not found).

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

Sidebar

Related Questions

Using pure functional languages can have a lot of benefits over using impure imperatives,
I am using a lot of HTTP Requests in an application that I am
I have a facebook app using a lot of Javascript that doesn't work correctly
I wrote a small app that turns out to be using a lot of
According to Spolsky I can't call myself a developer, so there is a lot
Can only seem to find articles that discuss using ashx files to implement a
Project Background: I am writing a map tile overlay class for java that can
I have a class object that i'm using a lot from different places. Now
I am creating an interactive iPad App, that is using a lot of Swiping
Recently I've been using lot of assembly language in *NIX operating systems. I was

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.