read metacharacter [ and ]

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting read metacharacter [ and ]
# 1  
Old 01-15-2008
read metacharacter [ and ]

i have command sed

sed '/^[ ]*$/ d' which don't recognize the [ and ]

how can i solve it?
# 2  
Old 01-15-2008
I guess u r trying to delete the line starting with [ ]

In that case, try the following:

sed '/^\[ \]*/ d' <filename>
# 3  
Old 01-15-2008

but i don't want to delete bracktes but to read them using the command:

sed '/^[ ]*$/ d'

any help
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Find command with Metacharacter (*) Should match exact filename

Hi, Below is list of files in my directory. -rw-rw-r--. 1 Roots Roots 0 Dec 26 06:58 12345_kms_report.csv -rw-rw-r--. 1 Roots Roots 0 Dec 26 06:59 12346_kms_report.csv -rw-rw-r--. 1 Roots Roots 0 Dec 26 06:59 12347_kms_report.csv -rw-rw-r--. 1 Roots Roots 0 Dec 26 06:59... (2 Replies)
Discussion started by: Balraj
2 Replies

2. Shell Programming and Scripting

[Bash] Read History function & Read Arrowkeys

Hi. How can I create a history function? (By "read" command or so) & How can I configure a read command so that the arrow keys are not displayed so funny? (^[[A) Thanks in advance. (4 Replies)
Discussion started by: sinnlosername
4 Replies

3. Homework & Coursework Questions


how to list all filenames consisting of two lower case letters using metacharacters? (1 Reply)
Discussion started by: rathankumar
1 Replies

4. UNIX for Dummies Questions & Answers

When reading a csv file, counter to read 20 lines and wait for minute then read next 20 till end

Hello All, i am a newbie and need some help when reading a csv file in a bourne shell script. I want to read 10 lines, then wait for a minute and then do a reading of another 10 lines and so on in the same way. I want to do this till the end of file. Any inputs are appreciated ... (3 Replies)
Discussion started by: victor.s
3 Replies

5. Shell Programming and Scripting

How to remove metacharacter while using wget command

Hi All, While using below command I am getting some unusual character in Release.txt file.How could I remove or stop them to go into Release.txt file wget -q cat Default.aspx|egrep -in "EFS|HOTFIX" | awk -F/ '{print $(NF-1)}'|cut -d... (1 Reply)
Discussion started by: anuragpgtgerman
1 Replies

6. Shell Programming and Scripting

Read Embedded Newline characters with read (builtin) in KSH93

Hi Guys, Happy New Year to you all! I have a requirement to read an embedded new-line using KSH's read builtin. Here is what I am trying to do: run_sql "select guestid, address, email from guest" | while read id addr email do ## Biz logic goes here done I can take care of any... (6 Replies)
Discussion started by: a_programmer
6 Replies

7. Shell Programming and Scripting

grep'ing a variable that contains a metacharacter ($) with a while loop

This is driving me crazy, and I'm hoping someone can help me out with this. I'm trying to do a simple while loop to go through a log file. I'm pulling out all of the lines with a specific log line, getting an ID from that line, and once I have a list of IDs I want to loop back through the log and... (2 Replies)
Discussion started by: DeCoTwc
2 Replies

8. UNIX for Advanced & Expert Users

read() wont allow me to read files larger than 2 gig (on a 64bit)

Hi the following c-code utilizing the 'read()' man 2 read method cant read in files larger that 2gig. Hi I've found a strange problem on ubuntu64bit, that limits the data you are allowed to allocate on a 64bit platform using the c function 'read()' The following program wont allow to allocate... (14 Replies)
Discussion started by: monkeyking
14 Replies

9. Shell Programming and Scripting

how to use scp with metacharacter

hi i have a file name : file^name that i need to scp to different machine without changing the name scp file^name user@machine/file^name its throwing the error cant use ^name(Something like this) any solution i already tried differnt combinations like "user@machine/file^name"... (2 Replies)
Discussion started by: narang.mohit
2 Replies

10. Shell Programming and Scripting

Null metacharacter?

Ok, here's what I'm trying to do: I'm trying to formulate an <expression> that will match any of the following: *.jpeg *.jpg *.JPEG *.JPG for a 'find <directory> -name <expression> ' command. I'd like to do *., but don't know what the null character is, or even if it exists. Any... (6 Replies)
Discussion started by: kidcharles
6 Replies
Login or Register to Ask a Question