[SOLVED] A question about the default tabstop in bash being 8.
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I just Googled and found one thread which rambled on about why you should not change it, but never talked about how TO change it. Pretty soon they were talking about how missionaries tried to change Bulgarian grammar. Now I have a headache......
Perhaps it is in the PS1 env. variable? Why can't I do "man PS1" on my machine? ARRRRRRRRRRRGH!!
I guess the origins of tab stops every 8 characters are in typewriters and thence in teletypes which were the commonest terminal in the early days of UNIX. Neither typewriters not teletypes had standardised tab stop positions but 8 was chosen as the commonest value.
Bash itself does not define the tabstop spacing; do you mean the terminal's tabstop spacing?
That's what I meant, the terminal. I don't really know.
If your terminal has tabstops set at 12 characters, the same file would look like this:
How could you change your terminal tabstop setting?
I would assume it's the programs themselves that are doing it, I guess. I thought maybe it's altered in some way by something. I looked at that site, and it said "If your terminal has tabstops, etc." like I just quoted. The cat output was changed when the tabstop setting was different. I looked at the thread you posted the link to here, and used the setterm -regtabs 4 and it didn't change my cat output. The tabstops are still 8.
I read it, it's just one of those questions where everyone's answer for it differs, and using their suggestions doesn't appear to work. I assumed that maybe it wouldn't be possible, since it would be the program doing it, and not bash or the terminal. I tried a couple of things that people suggested, and it wouldn't work. I wouldn't really mark this as solved, since I still don't see how you could do it really ... but I guess it's not too big of a deal.
What sort of terminal are you using? According to the setterm man page, -regtabs (an its other tab controls) only work on virtual terminals.
That makes sense; only when the terminal device is controlled by Linux itself can it control the tab stops. For other terminal types -- hardware (!) and hardware emulators including terminals in graphical windows -- then it's the device itself that has to be configured. How to do that is dependent on the device itself. What sort of terminal are you using?
The tabstops set in vi only control how vi displays them; it doesn't affect the saved file which simply contains tabs. regtabs only controls virtual terminals. I believe those are the ones you get using Ctrl+Alt+F[1-6] so does not include gnome-terminal.
Thanks for your help, I'm sure this is all the information I need. I'm gonna mark this as solved, because I have the information I personally needed, but I haven't done this. I haven't gotten it to work yet, but I know this is all the information I really needed to help me solve this problem. I just wanted to be pointed in the right direction at least, and have a yes/no answer as to whether or not it could or should be done.