LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-18-2007, 10:48 AM   #1
lnthai2002
Member
 
Registered: Jan 2005
Location: Montreal, QC, CANADA
Distribution: Red Hat Fedora
Posts: 135

Rep: Reputation: 15
Question how can i express special character in some command?


Hi guys,
I have a lot of text file need to be formatted so i am getting my hand dirty with the shell for a week. Right now i have a problem with the delimiter in some command like cut. I want to set the delimiter to a tab but i dont know how to express a tab in a linux command. i havw tried /t, Ctl-v tab
for example:
Code:
cut -d/t -f1 myfile
cut -d(i typed ctrl-v tab here) -f1 myfile
but none of them seem to work
Can anyone tell me how to express tab and space in the shell command?
Thanks in advance
 
Old 06-18-2007, 11:03 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Put it between double quotes:

cut -d"ctrl-v tab" -f1 file

Hope this helps.
 
Old 06-19-2007, 12:24 PM   #3
dawkcid
Member
 
Registered: May 2007
Location: UK
Distribution: LFS,Slackware,Slamd64,NetBSD
Posts: 102

Rep: Reputation: 15
Er, the default delimiter is a tab anyway...

man page:

Code:
       -d, --delimiter=DELIM
              use DELIM instead of TAB for field delimiter
 
Old 06-19-2007, 12:43 PM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

LOL

Of course it is! Why did I think it was a space.......
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
block special and character special files s_shenbaga Linux - Newbie 4 06-23-2015 02:16 AM
Insert a special character with the keyboard? Schreiberling Linux - General 0 03-05-2006 09:09 AM
special character boolim Linux - General 1 08-29-2003 09:57 AM
how to echo special character question ArnaudVR Linux - Software 1 06-29-2003 11:11 AM
i need help with a special character Hone101 Linux - Newbie 1 05-03-2003 07:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration