Shell scripting

Posted on 2007-08-12
Last Modified: 2012-05-05
How do I remove control characters from a shell script command-line argument

A shell script is automatically invoked with a total of 9 command-line arguments. One argument is being received with an angled bracket embedded in the text - example follows:

Firewall PIX port 3 denied access > MAC unknown

Angled bracket is being processed as a redirect character and a file named "MAC unknown" is created

So, how do I remove angled bracket from command-line argument???

Question by:viborg86
    LVL 51

    Accepted Solution

    depends on your shell, for example you have your characters in variable $arg1
    # (t)csh syntax
    # sh and friends
    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Suggested Solutions

    This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
    This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
    Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now