?
Solved

Shell scripting

Posted on 2007-08-12
3
Medium Priority
?
207 Views
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???

0
Comment
Question by:viborg86
2 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 500 total points
ID: 19682050
depends on your shell, for example you have your characters in variable $arg1
# (t)csh syntax
   $arg1:q
# sh and friends
  "$arg1"
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20633910
Forced accept.

Computer101
EE Admin
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
Utilizing an array to gracefully append to a list of EmailAddresses
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses
Course of the Month13 days, 22 hours left to enroll

809 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