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

The Archive Base Latest Questions

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

I use the homebrew package manager and the z-shell. I’m trying to implement a

  • 0

I use the homebrew package manager and the z-shell. I’m trying to implement a function to create a list of available packages that would be accessible to the grep function. Here’s what I’ve got so far:

function bsearch() {
 brew search | less >| ~/.brewsearch; grep $1 ~/.brewsearch
}

The problem I’m facing is that I’m not sure of what to put in place of $1. I’d like to be able to run the command as follows:

bsearch foo

but what ends up happening is that the function ends up looking for a file because of the argument $1.

In short, the question seems to be: how do I allow for a string in this function? (I’m new to all this).

Thanks for the help!

  • 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-24T06:23:27+00:00Added an answer on May 24, 2026 at 6:23 am

    You don’t need to write a function. Just run brew search foo.

    The command also accepts a regular expression between slashes, e.g. brew search /foo/

    Check Homebrew’s man page (man brew) for more details.

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

Sidebar

Related Questions

I use Homebrew as the package manager. I run this command: brew update But
Imagine you homebrew a custom gui framework that doesn't use windows handles (compact framework,
I'm running git 1.7 on Mac OSX, installed via Homebrew. I'm trying to use
How to use macports and homebrew package management systems together without having them interfere
I'm trying to use the Homebrew install script: /usr/bin/ruby -e $(curl -fsSL https://raw.github.com/gist/323731) It
I am trying to build a homebrew web brower to get more proficient at
For the last few days, I have been trying to use Python for some
I'm trying to use Heroku Taps but after gem install taps, I'm still getting
I'm trying to use the ncurses-0.2 library from hackage, however whenever I'm trying to
I'm trying to develop an application server that will deliver content to a core

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.