LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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!

Notices


Reply
  Search this Thread
Old 02-08-2010, 03:45 PM   #1
john6443
LQ Newbie
 
Registered: Feb 2010
Posts: 19

Rep: Reputation: -6
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?
 
Old 02-08-2010, 03:48 PM   #2
jrtayloriv
Member
 
Registered: Jun 2004
Location: Inland NW, US
Distribution: Ubuntu
Posts: 365
Blog Entries: 1

Rep: Reputation: 44
#1 -- you can't
#2 --
Code:
sh name-of-script.run
 
Old 02-08-2010, 03:50 PM   #3
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,087

Rep: Reputation: 407Reputation: 407Reputation: 407Reputation: 407Reputation: 407
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
 
Old 02-08-2010, 03:51 PM   #4
irmin
Member
 
Registered: Jan 2010
Location: the universe
Distribution: Slackware (modified), Slackware64 (modified), openSuSE (modified)
Posts: 342

Rep: Reputation: 62
.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??
 
Old 02-08-2010, 03:57 PM   #5
john6443
LQ Newbie
 
Registered: Feb 2010
Posts: 19

Original Poster
Rep: Reputation: -6
ah i see thx all
 
Old 02-08-2010, 04:19 PM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,087

Rep: Reputation: 407Reputation: 407Reputation: 407Reputation: 407Reputation: 407
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 .
 
Old 02-08-2010, 05:02 PM   #7
john6443
LQ Newbie
 
Registered: Feb 2010
Posts: 19

Original Poster
Rep: Reputation: -6
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?
 
Old 02-08-2010, 05:08 PM   #8
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Stretch/Sid, Linux Mint DE
Posts: 4,606

Rep: Reputation: 686Reputation: 686Reputation: 686Reputation: 686Reputation: 686Reputation: 686
Quote:
Originally Posted by john6443 View Post
change wms
What is a wms?

you switch users by typing 'su <username>'

jlinkels
 
Old 02-19-2010, 01:30 AM   #9
john6443
LQ Newbie
 
Registered: Feb 2010
Posts: 19

Original Poster
Rep: Reputation: -6
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?
 
Old 02-19-2010, 01:34 AM   #10
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

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

Evo2.
 
Old 02-19-2010, 02:19 AM   #11
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Quote:
Originally Posted by john6443 View Post
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?
 
Old 02-19-2010, 08:26 AM   #12
mudangel
Member
 
Registered: May 2008
Location: Ohio
Distribution: Slackware
Posts: 267

Rep: Reputation: 56
Case insensitivity in DOS is a limitation, not a feature.
 
Old 02-19-2010, 08:47 AM   #13
JimBrewster
Member
 
Registered: Feb 2010
Location: usa:/dev/random
Distribution: Slackware, Salix
Posts: 237

Rep: Reputation: 59
Quote:
Originally Posted by jlinkels View Post
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 ). 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.
 
Old 02-19-2010, 08:51 AM   #14
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
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.
 
Old 02-19-2010, 10:53 AM   #15
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,144

Rep: Reputation: 886Reputation: 886Reputation: 886Reputation: 886Reputation: 886Reputation: 886Reputation: 886
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.

Last edited by schneidz; 02-19-2010 at 11:01 AM.
 
  


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 scripting questions: Geminias Programming 3 08-06-2007 08:58 AM
Bash script questions. ArthurHuang Programming 6 03-20-2007 10:59 PM
bash questions xeon123 Linux - General 2 11-23-2006 05:00 AM
Simple Bash Questions RAdams Programming 8 08-23-2006 09:48 AM
Bash scripting questions irfanhab Programming 2 06-07-2004 12:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration