Software :: No Bash Completion With Apt In Su Session?
Mar 28, 2011
I have disabled root ssh logins for security. When I am logged in as a normal user over SSH and do a su into root the tab-completion stops working with apt. It still works when doing normal file-browsing, on the original user1, and it has worked previously when logged directly into root. How do I make it autocomplete again? I am using Debian Stable on a headless homeserver.
View 3 Replies
ADVERTISEMENT
Jun 2, 2010
I switched to zsh, but I dislike the completion. If I have 20 files, each with a shared prefix, on pressing tab, zsh will fully complete the first file, then continue going through the list with each press of tab. If I want one near the end, I would have to press tab many times.
In bash, this was simple - press tab and I would get the prefix. If I continued typing (and pressing tab), bash would complete as far as it could be certain of. I find this behavior to be much more intuitive but prefer the other features of zsh to bash.
Is there a way to get this style of completion? Google suggested setopt bash_autolist, but this had no effect for me (and no error message was printed upon starting my shell).
View 1 Replies
View Related
Dec 10, 2009
New Fedora 12 install - I installed the bash_completion package, but it's not filling in knowhosts for ssh. It worked fine in Fedora 11. Is there something I've done wrong, or is this missing in F12?
View 6 Replies
View Related
Dec 15, 2010
I wondered if theres a way to do rotational style completion in bash similar to the behavoir on cmd.exe, I've found it speeds me up in regard to entering commands
View 2 Replies
View Related
Apr 29, 2010
Just installed 10.04 64bit and in gnome-terminal i have no bash completion when sudo is used.For example:apt- gives apt-getbut sudo apt- does nothing, i get no suggestions from the terminal.
View 6 Replies
View Related
Jul 12, 2011
Can fedora do bash completion of package names in yum?
View 4 Replies
View Related
Jul 17, 2010
Out of the box, Bash in 10.04 is configured such that it won't expand/complete parameters when there's a single match for a parameter with a leading wildcard. For example, if I have the following files in a directory:
Code:
ABC.bin
DEF.bin
GHI.bin
...and I type cp *E*, I expect to be able to press TAB and have Bash expand *E* to DEF.bin, since that's the only file in the directory with a capital E in its name.
(Note: if I actually submit the command with the wildcards in place, the correct file will be used then, but I don't get to see it beforehand.) I imagine there's something in /etc/bash_completion that's preventing this from working properly. Does anyone know what it is?
View 1 Replies
View Related
Aug 26, 2010
[URL]
Code:
#if [ -f /etc/bash_completion ]; then
# . /etc/bash_completion
#fi
What versions of Ubuntu have this commented out? Every version I have used always has this uncommented.
View 1 Replies
View Related
Feb 16, 2010
I am writing completion function for one PHP framework called symfony. It has command line interface with syntax:
Code:
symfony [options] [namespace:]action
I want to make action be autocompletable. The function is simplest so far:
Code:
function _symfony_commands()
{
[ -r "cache/completion/.sf" ] && cat cache/completion/.sf
}
[code]....
But, if there is : symbol which separate namespace from action problems coming:
symfony doct[TAB]
will be completed to
symfony doctrine:
But nothing happens if you want complete after : symbol. I've found out that for readline there is three words because it splits line with $COMP_WORDBREAKS
Code:
$ echo $COMP_WORDBREAKS
"'><=;|&(:
I played with $COMP_WORDS array and tried every thought I had to make it work, but failed.
What I should do to escape colon and make readline consider it as one word? Or there is way perhaps to workaround it?
View 2 Replies
View Related
Nov 25, 2009
According to the Bash man pages, Quote: HOSTFILE Contains the name of a file in the same format as /etc/hosts that should be read when the shell needs to complete a hostname. The list of possible hostname completions may be changed while the shell is running; the next time hostname completion is attempted after the value is changed, bash adds the contents of the new file to the existing list. If HOSTFILE is set, but has no value, bash attempts to read /etc/hosts to obtain the list of possible hostname completions. When HOSTFILE is unset, the hostname list is cleared.
Here's the line in my .bashrc where HOSTFILE is set:
Code:
export HOSTFILE="~/.hosts"
I opened a new bash session, created ~/.hosts, filled it with the names of servers that I wanted to expand using tab completion. then typed
Code:
ssh p<tab><tab>
expecting to get a lists of all of the hosts in ~/.hosts starting with 'p'. Bash simply beeped at me twice.
I tried
Code:
$ shopt hostcomplete
hostcomplete on
Code:
ssh bchittenden@p<tab><tab>
same results.
[code].....
View 2 Replies
View Related
Feb 27, 2011
Is there a way to get colored output when using tab completion in a terminal? My colors are fine everywhere else so I know that I've enabled a color terminal successfully. Using bash in Ubuntu (10.10).
View 1 Replies
View Related
Nov 15, 2010
tab-completion indexes system folders (like /usr/bin, /usr/local/bin)! so say i'm in a folder that has two files, 'text' and 'myprog', i type in an 'm' then tab, and i get hundreds of results including 'mysql', 'mysqlconfig', and others as im sure you can imagine. is there a way to set it to default or something else that will only make it index the current folder?
i tried changing my PATH variable so i could execute programs in the current directory without './' - what i added to PATH was ':.' at the end (apparently this is not the way to do it... :S). i tried resetting PATH various times ('unset PATH', 'PATH=$whatever...') but this has not fixed the problem. using 'unset PATH', of course, removes everything from PATH, which meant that functions (like 'ls') in /usr/bin and /usr/local/bin can't be found. obviously i want those to be found, but i would rather not tab through them!
View 2 Replies
View Related
Feb 16, 2011
/etc/bash_completion.d/slapt has a syntax error that causes x to fail to load. I had to move the file to be able to run x. Here is the offending file:
[URL]
View 12 Replies
View Related
May 27, 2011
I've spent some time searching for answers to this and I haven't found much at all.Please feel free to post pointers to other threads that discuss this particular problem, if you find any.The problem is that in bash I want to mount an iso file to inspect the contents with the command:Code:sudo mount myCD.iso CDMount -o loopThe command works fine, but pressing tab to complete either the iso filename or the CDMount directory does not work. The completion suggestions I get are existing mountpoints which The completion suggestions should include the files and directories in the current directory. This worked with Ubuntu 10.04 and not with 11.04.
View 1 Replies
View Related
Jan 20, 2011
I have a bash script that checks for contents in a folder every 15 seconds and then acts on it's contents. This works great for the average size file however on very large files it starts acting on the file before it's completely written. Is there a facility in bash shell to get a file complete signal or such? here is trigger to launch a larger script.
Code:
#!/bin/sh
while true
do
$HOME/bin/hpgl.sh >/dev/null 2>&1 &
[code].....
View 10 Replies
View Related
Apr 25, 2011
how to launch a non-login bash session that doesn't inherit its parents environmental variables, and doesn't source /etc/bashrc?
View 2 Replies
View Related
Apr 23, 2010
I am using CentOS 5.4. I created a bash script that does some checking before running any commands. If the check fails, it will simply exit 0. The problem I am having is that on our server, the script will exit the su or ssh session when the exit 0 is called.
#!/bin/bash
# check if directory has contents and exit if none
if [ -z "`ls /ebs_raid/import/*.txt 2>/dev/null`" ]; then
echo "ok"
exit 0
fi
Here is the output:
[root@ip-10-251-86-31 ebs_raid]# . test.sh
ok
[russ@ip-10-251-86-31 ebs_raid]$
I was removed from my sudo session, if I wasn't in the sudo session, it would have logged me out of my ssh session. I am not sure what I am doing wrong here or where to start.
View 1 Replies
View Related
Jun 20, 2011
I'm trying to execute some code (let's call it login.java) when I log in and out of my linux machine. Is there any way to do this? I'm looking for perhaps a way to trigger the code? I've thought of just putting it in my .bash_login but preferably the code would launch on normal login, not when I start my terminal.
View 2 Replies
View Related
Jul 28, 2010
I am trying to write a bash script to open 1 screen session with multiple windows... each one running a different service. Is this possible? I tried several things, and I can start up multiple sessions really easy.. but not 1 session with multiple windows...
I want this so I can attach to that session and quickly move between the different windows.
View 4 Replies
View Related
Feb 22, 2010
I got this script that backs up a server and then keeps only the last 10 backups and removes the rest.Problem is, the part where it deletes any backups older than the last 10, it never reaches that. I'm guessing it is because the ftp session somehow exits the script entirely, especially if there is a problem with the ftp session. But just to make sure, I'm wondering if you all can look at the code to see if I am making it exit accidentally.Here's the code. I left out data like ip address and directory/file names for my security purposes.
Code:
#ftp in and grab the file
ftp -in xx.xx.xx.xx << EOF
[code]...
View 5 Replies
View Related
Apr 12, 2010
hypothetically speaking, can i write a script in which a telnet session is opened and then some more commands are forwarded to that session?
View 4 Replies
View Related
Nov 10, 2010
I have a very bad attempt at hashing the components of an tcp session to assign/locate the session in a hash table bucket. I am pretty sure that it has a very high collision rate and when there are a very large number of tcp sessions my application is having to search a long linked list to find the session within the bucket.
All the hashing functions I have found take a single string input where I need to input several integers and hash them into a single result. My guess is that any real hashing function is going to produce better results than what I am currently doing.
[Code]...
View 2 Replies
View Related
Nov 1, 2010
Is there a session manager I can use with 10.10? I would like to try Openbox but am not sure how to select it as a startup session. I would like to be able to choose between kde, gnome and openbox.
View 1 Replies
View Related
Jan 22, 2010
I am putting together some new systems for my customer and I'm having some trouble with a script that we use to back up files to a DVD R. The problem is that I can't write a 2nd session to the DVD unless I eject the disk and reload it. The drives are slimline type drives, Sony BD-5730S and Teac DV-W28S-V93, so they won't reload without human intervention. Opsys is CentOS 5.4 or RHEL 5.4. I've tried both AMD and Intel based mother boards. If i try this on Fedora 11 or 12 it works fine. This works on IDE attached drives but not a SATA attached drives. Fedora appears to use something called genisoimage instead of mkisofs. I can't get genisoimage to run on CentOS or RHEL.
Here's the code to setup the test files:
rm -f /tmp/BDtest/*
mkdir /tmp/BDtest
dd if=/dev/zero of=/tmp/BDtest/blank.iso bs=10M count=1
for NUM in {1..160}
[Code].....
View 2 Replies
View Related
Jul 28, 2010
Is it possible to use TAB completion in a script. For example I have a folder (A) that contain only one folder (B) and the script file.
Quote:
mahmood@localhost:A$ ls
B
script.sh
How can I send TAB key code in script?
View 2 Replies
View Related
Nov 14, 2015
I'm having a lot of difficulty trying to use tab completion while working in my FTP server from a terminal.I access this server with other Linux distros and OSX and the completion works fine. I've tried changing a lot of Debian config, but it seems to only affect the completion within the local scope.
Tab completion does work for system related tasks, no problem.
System:
Debian 8.2/Kernel 3.16.0-4-amd64
FTP Server:
Trendnet TS-I300 NAS with FTP/upnp
Settings:
Enabled in bashrc:
Code: Select allif ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
View 5 Replies
View Related
Aug 4, 2010
Are there shell versions that have a more intelligent tab completion? I'd like to be able to type cd foo-<TAB> Then it would show me the possible completions along with numbers that I can type to select one of them:
cd foo-<TAB>
(1) foo-bar1 (2) foo-bar2 (3) foo-bad
So, after <TAB> I would type 3 and it would take me to foo-bad. Alternatively, using the arrow keys instead of typing the number would be fine.
View 2 Replies
View Related
Jul 4, 2010
I tried to make a function to put in either my .bash_aliases or .bashrc file to make a local backup of a file, but when I call the function and try to use tab completion I get the following error:
Code:
cp: cannot stat `help': No such file or directory
The function I added is as follows:
Code:
function bk
[Code]...
Also interestingly, if I define this function at the prompt rather than in my .bashrc, tab completion works fine.
View 3 Replies
View Related
Jul 5, 2010
I tried to make a (very simple) function to put in my .bashrc file to make a local backup of a file, but when I call the function and try to use tab completion I get the following error: Code: cp: cannot stat `help': No such file or directory The function I added is as follows:
Code: function bk
{
cp -f --backup=numbered ${1} ${1}.bak
[code]....
View 2 Replies
View Related
Jul 18, 2011
I am using ubuntu 9.04. I created new users, & users logged in with their name & password. Everything is working fine. But when they open gui terminal or when they login using CLI(using ctrl+alt+f1), they will get only "$" symbol, instead of full path like pwd, hostname, etc. And if I do ls, it is listing the content, but command completion is not happening, i.e $cd Des(pressing tab). These all things can be fixed only after pressing "bash". So I don't always want to press "bash". So is there any way that I can fix this issue.
View 6 Replies
View Related