LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   bash questions (https://www.linuxquestions.org/questions/linux-newbie-8/bash-questions-787851/)

john6443 02-08-2010 03:45 PM

bash questions
 
i got some questions about bash, i am using bash-3.1
1. how can i turn off the case sensitivity? you have to type exactly the letters i want to turn this off

2.how do i run files with the extention .run on the command line?

jrtayloriv 02-08-2010 03:48 PM

#1 -- you can't
#2 --
Code:

sh name-of-script.run

tredegar 02-08-2010 03:50 PM

Quote:

how can i turn off the case sensitivity? you have to type exactly the letters i want to turn this off
You cannot. That's just the way it is. For good reasons.
Quote:

how do i run files with the extention .run on the command line?
chmod +x /path/to/file.run
or
sh /path/to/file.run

irmin 02-08-2010 03:51 PM

.run files are normally simple shell scripts. Just type "sh <run-file>".

Normally it is not possible to turn off case sensitivity. You can turn make globbing case insensitive and also pattern matching, but not in general.

Under Linux "filename", "FileName" and "Filename" name different files. So if you had a file for each of that name and you enter "FILENAME". What file should be selected??

john6443 02-08-2010 03:57 PM

ah i see thx all

tredegar 02-08-2010 04:19 PM

Quote:

ah i see thx all
Pleased we seem to have cleared that up then :).

But is your <SHIFT> key broken? You don't seem to be able to type any CAPITALS.

Or spell :(.

john6443 02-08-2010 05:02 PM

my shift keys are working, whats wrong with my spelling 0_0
i just figure how to mount/adduser and change wms but i dont know how to switch users on the console yet how do you do this?

jlinkels 02-08-2010 05:08 PM

Quote:

Originally Posted by john6443 (Post 3857180)
change wms

What is a wms?

you switch users by typing 'su <username>'

jlinkels

john6443 02-19-2010 01:30 AM

so how do you disable the case sensitivity in slackware? having to type lower and upper cases is just slowing down productivity. how do you make it auto detect whatever you typing like in dos?

evo2 02-19-2010 01:34 AM

Are you aware of Tab completion? Ie type the start of a command or command argument and hit <Tab>.

Evo2.

GrapefruiTgirl 02-19-2010 02:19 AM

Quote:

Originally Posted by john6443 (Post 3869043)
so how do you disable the case sensitivity in slackware? having to type lower and upper cases is just slowing down productivity. how do you make it auto detect whatever you typing like in dos?

As mentioned earlier, Linux is case-sensitive regarding commands and filenames (and most things). So, you cannot "turn off" case sensitivity.

Dos does not "auto detect" anything when you type-- it simply ignores case, so "dos" and "DoS" and "dOs" will all refer to a file named "DOS". So, if you have one file named "Dos" and you try to create a file named "DOS" it will tell you the file already exists :/

What exactly are you having to type in both cases that is slowing you down so much? I ask because maybe you would like to make some lowercase aliases for commands that are dual-case? For example, if you need to type a command like "PrintItALL", you could make an alias of "printitall" so you could run the command by typing that all in lowercase. Might that help?

mudangel 02-19-2010 08:26 AM

Case insensitivity in DOS is a limitation, not a feature.

JimBrewster 02-19-2010 08:47 AM

Quote:

Originally Posted by jlinkels (Post 3857187)
What is a wms?

I assume Window Managers?

In Slackware it depends on your runlevel.

If you have a graphical login, look for the menus (probably at the
bottom). There should be a menu called "Sessions" or some such that will list choices like KDE, XVCE, FVWM2, etc., etc.


OTOH, if you enter X by typing startx at the console, then it is determined first by ~/.xinitrc. If there is no ~/.xinitrc, it will be determined by a file called "xinitrc" in either /etc/X11 or /etc/X11/xinit (sorry I'm at work on a M$ box :doh: ). That file will probably be a sym-link to xinitrc.<currentwm>.

To change your wm, you can delete ~/.xinitrc and create a new symlink as ~/.xinitrc to the desired xinitrc in the /etc/X11 directory describe above, or (better) make a copy of that xinitrc as ~/.xinitrc, and edit it to your liking.

i92guboj 02-19-2010 08:51 AM

As long as your bash is compiled with readline support on it you should be able to disable at least the case sensitivity for TAB autocompletion, like this:

Code:

echo 'set completion-ignore-case on' > ~/.inputrc
However, as the other people have said, this is something you shouldn't be doing. The sooner you open your eyes and accept the reality the happier you will be. You can't disable case sensitivity as a whole, and ignoring the case will only bring you problems and nothing else. Often people will give you detailed instructions on how to do the things, if you ignore the case then you will do everything the wrong way, and then you will end wandering why the heck nothing works as it should.

It's the way Linux (and I'd say 100% of UNIX systems) are. It's also the way that real life is. So, people usually write "Dear John" and not "dear john" when writing a letter. It helps to avoid ambiguity and confusion when your best friend is called something like Crystal Lamb. I guess that's also why tredegar above asked about the health state of your SHIFT key, because you don't use any capitals at all in your posts. Not that it harms too much the thread though.

schneidz 02-19-2010 10:53 AM

i never use capitals either (its just an extraneous keystroke).

when i was in college we created a my-shell program in lab.

case-insensitivity can theoretically be accomplished by doing something like brushing tr [A-Z] [a-z] across every command the user submits to the command-line but it would likely hinder more than it would help.

my systems are usually 90 % case-insensitive because most commands are lower-case and all my filenames dont have weird punctuation like capitals, spaces, ... so i stay sane and productive.


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