LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   how can i express special character in some command? (https://www.linuxquestions.org/questions/linux-general-1/how-can-i-express-special-character-in-some-command-562686/)

lnthai2002 06-18-2007 10:48 AM

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

druuna 06-18-2007 11:03 AM

Hi,

Put it between double quotes:

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

Hope this helps.

dawkcid 06-19-2007 12:24 PM

Er, the default delimiter is a tab anyway...

man page:

Code:

      -d, --delimiter=DELIM
              use DELIM instead of TAB for field delimiter


druuna 06-19-2007 12:43 PM

Hi,

LOL

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


All times are GMT -5. The time now is 10:16 AM.