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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:22:37+00:00 2026-06-17T22:22:37+00:00

I am trying to write a bash script so that I will use to

  • 0

I am trying to write a bash script so that I will use to replace my egrep command. I want to be able to take the exact same input that is given to my script and feed it to egrep.
i.e.

#!/bin/bash
PARAMS=$@
`egrep "$PARAMS"`

But I have noticed that if I echo what I am executing, that the quotes have been removed as follows:

./customEgrep -nr “grep my ish” *

returns

egrep -nr grep my ish (file list from the expanded *)

Is there a way that I can take the input literally so I can use it directly with egrep?

  • 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-17T22:22:38+00:00Added an answer on June 17, 2026 at 10:22 pm

    You want this:

    egrep "$@"
    

    The quotes you type are not passed to the script; they’re used to determine word boundaries. Using "$@" preserves those word boundaries, so egrep will get the same arguments as it would if you ran it directly. But you still won’t see quotation marks if you echo the arguments.

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

Sidebar

Related Questions

I'm trying to write my first semi advanced bash script that will take input
I am trying to write a simple bash script that will use a list
I am trying to write a bash script that will take a text file
I'm trying to write a bash script that will process a list of files
I am trying to write a bash or PHP script that will execute a
I'm trying to write a bash script that will let me download multiple web
I am trying to write a simple bash script that will search for files
I'm trying to write a bash script that will run on both Mac and
so what I'm trying to do is to write a Bash script that will
I'm trying to write a bash script that will log the connection state of

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.