LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 12-17-2008, 06:59 PM   #1
kaldrenon
LQ Newbie
 
Registered: Dec 2008
Location: (near) Philadelphia, PA
Distribution: Ubuntu currently
Posts: 9

Rep: Reputation: 0
Still getting to know Bash, question about tab-completion


Hey guys.

---
Preface: Ubuntu 8.10: I've been doing a lot of tinkering with various software lately, but I haven't (deliberately or directly) made modifications to any system files except /etc/fstab
---

I'm currently having an issue with operating in bash via either PuTTY or xterm. I'm fully willing to believe that I caused the change by doing something I didn't mean to, but I really am unclear as to what I did or how to fix it.

Here's the problem: commands that I try to execute in Bash seem to be looking at a different directory than my working directory. Take a look at this sample output:

Quote:
andrew@toumar:~$ pwd
/home/andrew
andrew@toumar:~$ ls
Documents
Music
Pictures
Public
Templates <-- !
test
Videos
andrew@toumar:~$ Thunar <-- ?
As you can see, I am in a directory with one item that starts with a capital T, which is Templates, but when I type a 'T' and hit tab, I get Thunar. I also can't seem to execute CideroApps_unix_1_5_3.sh with ./ when I'm in that directory (although I could be mistaken about ./ as the way to execute .sh files).

I'm pretty lost about what I need to do, because I'm not clear on how I got myself here. Any advice would be greatly appreciated, and I can gladly provide more information if it might be useful.

Thanks!
 
Old 12-17-2008, 07:16 PM   #2
wernerz
Member
 
Registered: Jun 2008
Location: Ottawa, Ontario, Canada
Distribution: debian, dsl-n
Posts: 55

Rep: Reputation: 15
This is because bash is looking for an executable file in it's path. You need to tell bash what you want to do to a regular file before hitting tab. For example, to edit Templates you would type gedit T then hit tab. To change directory you would do cd T then tab etc.

To execute a file in the current directory you need to do the ./"command". The CideroApps_unix_1_5_3.sh file is probably not set to executable. Do a chmod 755 CideroApps_unix_1_5_3.sh then try again.
 
Old 12-17-2008, 07:18 PM   #3
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,072
Blog Entries: 3

Rep: Reputation: 323Reputation: 323Reputation: 323Reputation: 323
when you type T then hit tab the bash looks for a bin execute file hence /bin/bash and Thunar is a executable file in any file named bin. thunar so if you have a litle file and turn it to a executable chmod -x-a your file or open with a gui and set permission to executable. sence it is not in a bin folder you will have to type ./your file name. or sh your file name.if it was in bin or /usr/bin or /usr/local/bin or any folder you name bin the if the file is in a folder owned by root you will need to have SU privaledges to execute it and the bash will not see it. but if the folder is set to -x-a all users then you can type it and run it. in a terminal. hope this helped please go to unix comands and
 
Old 12-17-2008, 07:24 PM   #4
kaldrenon
LQ Newbie
 
Registered: Dec 2008
Location: (near) Philadelphia, PA
Distribution: Ubuntu currently
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks for the help! I still need to learn my way around bash
 
Old 12-17-2008, 11:16 PM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,541
Blog Entries: 23

Rep: Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943
Hi,

Look at my sig!
 
Old 12-19-2008, 09:51 AM   #6
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Rep: Reputation: 35
The ground has been pretty well covered, but the thing is:
"Thunar" is an executable.
"Templates" is a Sub-Directory containing templates for your use.
$ T (tab) gets the executable, not the Directory.
 
  


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 auto-completion question PatrickNew Linux - General 3 05-03-2008 12:31 AM
Tab-completion kzr_merchant Programming 2 12-17-2007 05:00 PM
Tab-Completion in bash script Buto Linux - General 1 12-04-2007 07:50 PM
filetype aware tab completion bash gearoid_murphy Linux - General 2 10-29-2006 07:52 AM
question about bash completion Guest1234 Linux - Software 4 02-25-2006 05:09 PM


All times are GMT -5. The time now is 06:29 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration