LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-04-2006, 06:56 PM   #1
pchernik
LQ Newbie
 
Registered: Aug 2006
Posts: 6

Rep: Reputation: 0
Setting shell tab stop


Hi All,

Is there a way to set the shell tab stop (tab width?) in Linux (and also Solaris) for terminal output from utilities like echo, cat, diff, grep, etc?

I.e. I would like to use tab width 4 instead of 8, and if I do:

echo "123<tab>4"

I'd like to see (using dots instead of space, for clarity):

123.4

instead of

123.....4

Which is the case with default tab width of 8.

Any info / suggestions are appreciated.

Thanks,
-Pavel
 
Old 08-04-2006, 09:23 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
If I read the man page correctly, "setterm -regtabs 4" will do it.
 
Old 08-04-2006, 11:46 PM   #3
pchernik
LQ Newbie
 
Registered: Aug 2006
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bigrigdriver
If I read the man page correctly, "setterm -regtabs 4" will do it.
I can't find setterm.... man setterm provides C function info.

Red Hat:
$ setterm
bash: setterm: command not found

Solaris:
=->setterm
ksh: setterm: not found
 
Old 08-05-2006, 03:42 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Ubuntu/WSL
Posts: 9,784

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
For Solaris, use the tabs command, eg:
Code:
tabs -2
printf "a\tb\tc\td\n"
tabs -4
printf "a\tb\tc\td\n"
I haven't a Linux box available right now to check if this applies to it too.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash - how to open a new shell tab infraredgirl Programming 4 03-30-2006 07:23 PM
Tab autocomplete like windows shell? lerceon Linux - Newbie 2 04-17-2005 09:25 PM
Tab key function on tcsh shell and redhat 8.0 jeff_lim1974 Linux - General 0 06-21-2004 04:43 AM
hotkey to open new shell tab in KDE? Yohhan Linux - Software 2 05-01-2004 02:45 PM
how do I stop kde from the shell? qsir1 Linux - General 2 02-06-2004 12:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:49 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