bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Syntax for tab character


From: Bill Gradwohl
Subject: Syntax for tab character
Date: Fri, 24 Apr 2009 11:32:09 -0600

I know that 
   parameter="${parameter//[0123456789]}" 
will remove all numerics

What I want to do is remove all the space and tab characters.
So far I've only been able to do it as follows:

   parameter="${parameter// }"        #:# Convert any spaces to null
   parameter="${parameter//'\t'}"     #:# Convert any tabs to null

I can't find a way to put both a space and a tab inside a [] construct
so as to be able to state it in one line of code. I don't want to put an
invisible tab character into the [] construct, I want to put the visible
'\t' in it.

Is there a way to say it that is syntactically correct?
[ \t]      # doesn't work
[ '\t']    # doesn't work

I've even tried assigning as follows:
spaceTab=' \t'
[${spaceTab}]   # doesn't work

-- 
Bill Gradwohl

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]