Hey folks, another linux/unix newbie here trying to get some basics down. I cant seem to find out how to search for a "tab" using the grep command. Here are some things ive tried so far:
grep '<tab>' filename
grep '(actually hitting tab here)' filename
grep '/t' filename
grep '\t' filename
grep '[[:space:]]' filename
etc etc.
Does anyone know what the proper way to search for a tab is? The actual reason i need it is of course much more complicated than this example but just knowing how to find tab would be enough. Thanks a ton!
You may be able to just use the ASCII code for tab somehow. Just a thought. There probably is a cleaner way. Heh, I'm actually kinda surprised the '(actually hitting tab here)' didn't work.
I also replied back in the general forum. It does in fact work for awk but i need to make substitutions with sed actually so it complicates things. Is there a way to pipeline the output from awk into sed and change it that way? It would be easiest to see my other post
As for that little perl program, im totally perl illiterate! Ive only used C++ and assembly and im trying to learn shell programming for linux and unix now. Maybe ill get to perl eventually though. hehe, thanks for the help though!
Originally posted by morphman:
<STRONG>well, you dont have to look at the other post. they are independent except for the guy who actually pointed out that i have another post. </STRONG>
since I go to both Programming and General Linux questions, I see both. And it annoys me. Next time, post only in the most relevent section, not every one you feel you should put it in.
edit: normally the HAL's will lock or delete one of your threads if you cross-post. But they don't seem to be around right now....
Sorry bud, but what would you do? Nothing was happening on this post really and i need/needed answers as fast as i could because its really halting my progress and i need to make some big scripts, and the sooner the better. I feel i was justified in posting on the general linux questions because i need an answer if i can get it. Sorry if it ticks you off and i apologize for wasting your time because you read them both but i really need help.
Next time, it would probably be better if you posted to two completely separate places. (e.g. here and a newsgroup) Cross-posting in a forum is always a bad thing.
For anyone who was/is actually curious about the answer to my original question i found the answer. To insert a tab you hit ctrl + v then ctrl + i and that will insert a tab at the command prompt! Thanks for any help!
Bookmarks