Ubuntu :: .bashrc Function Tab Completion?
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
ADVERTISEMENT
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
Feb 25, 2010
I'd like a function in my .bashrc file that would allow me to pass text to it and echo the text to a specified file. I know it's simple as "echo 'text' >> file," but ideally, I would want to alias the function so I execute something like:
Code:
user~ $ write 'this is a test' with "write" being the function, and 'this is a test' being echoed to the file. I hope I explained that well enough.
View 3 Replies
View Related
Feb 28, 2010
I have added mkalias in my .bashrc file as I learnt here
[Code]...
View 1 Replies
View Related
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
Jun 14, 2011
When I add some path in .bashrc by commenting out old path and adding new one like this:
#EXPORT HOME_PLAY=/home/gem/old_play
EXPORT HOME_PLAY=/home/gem/play
EXPORT PATH=$PATH:HOME_PLAY
After saving above changes, I enter the command: source ~/.bashrc Now if I do echo $PATH, the path shows both the old PLAY_HOME and new PLAY_HOME. This is really bad and messes up a lot of things in my project. This problem only goes away if I logout or reboot, a rather very long process. What is happening is that the old path is added to new path element and the old path includes the old path element you want to remove.
View 10 Replies
View Related
Mar 24, 2011
I bought a multifunction stylus sx218 Espon model and I can not run the scanner function. I did some research and found a few solutions and very functional. I hope someone solves the problem. My version of openSUSE 11.2.
View 9 Replies
View Related
Nov 16, 2010
Code:
#include <iostream>
using namespace std;
[code]...
View 1 Replies
View Related
May 18, 2010
I am doing some Linux kernel programming for my research project. I need to record the timestamp (by using cpuid and rdtsc) when an interrupt handler (top half) is first invoked. Due to the time critical nature of the problem itself, I have to do the timestamping inside the interrupt handler itself (the first operation when the handler is called). However, I understand that tasks that are not so time critical should be deferred to a tasklet function (bottom half) for processing because other interrupts are disabled in a (top-half) interrupt handler. I am currently out of idea on how I can pass the timestamp information that I have obtained in the interrupt handler to the corresponding tasklet function.
View 2 Replies
View Related
Mar 30, 2011
I'm currently using OpenSuse 11.1 web server. This is bad since 11.1 is no longer supported. the reason why I am using it is because Function set_magic_quotes_runtime() was no longer being used. (so I was told)
That being said, is there a way to get Function set_magic_quotes_runtime() to function on the newer versions of OpenSuSE?
View 9 Replies
View Related
Feb 21, 2010
the function terminates if no key is pressed for 10 consecutive seconds. I tried using the -t option as suggested in some forums, but my version of showkey doesn't have the option of changing the timeout. The options I get are:
-h --helpdisplay this help text
-a --asciidisplay the decimal/octal/hex values of the keys
-s --scancodesdisplay only the raw scan-codes
-k --keycodesdisplay only the interpreted keycodes (default).
Is it possible to write a script to use this function and still keep the function active until an interrupt is recieved?
View 6 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
Mar 3, 2010
how to get tab completion working with sudo in JeOS (Ubuntu Hardy) 8.04? Assuming I have the command '/usr/bin/svnadmin'. As a normal user I can type:
Code:
svnad + TAB
and it auto-completes as 'svnadmin'. If I type:
Code:
sudo svnad + TAB
nothing happens. My 'echo $SHELL' is '/bin/bash'. I tried enabling the following in '/etc/bash.bashrc':
Code:
if [ -f /etc/bash_completion ]; then
[Code]...
auto-completes as I'd expect. I think I once read that there's some kind of configuration variable for sudo that causes it to use a 'more secure' path rather than the current path in the user's environment. I can't find any info on it though. I'm executing the commands from my home directory.
View 5 Replies
View Related
Jul 3, 2010
my version of Java is "1.6.0_20", it is the Java from package sun-java6-jdk from the repository.Version of Eclipse is 3.5.2 Galileo (but the new Helios has the same problem)The problem is that code completion (ctrl + space) freezes the Eclipse everytime I want to use it. There is nothing in the log (${WORKSPACE}./metadata/.log) and it seems to me like deadlock or something. When I run the Eclipse as root the problem don't occur.I tried to create new workspace, reinstall the eclipse,
View 2 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
Jul 17, 2010
I want an IDE such as phpDesigner or dreamweaver that has intelligent code completion feature built-in. If it's complete such phpDesigner; It will be prefered.
Quote:
Syntax highlighters in phpDesigner
Intelligent syntax highlighting, switch automatic between PHP, HTML, CSS and JavaScript
PHP (both version 4 and 5 are full supported)
SQL (MySQL, MSSQL 2000, MSSQL 7, Ingres, Interbase 6, Oracle, Sybase)
HTML/XHTML
CSS (both version 1 and 2.1 are full supported)
[Code]...
View 4 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
Mar 21, 2011
Is it possible to have command line completion similar to 4nt? In Terminal you have to type most of the name before it will complete for you, otherwise it just displays a list of names. Are you supposed to read from there and copy filenames? And the upper/lower case stuff is really ugly. Is there a smart command line utility that can build the entire path for you, and recall history based on a partial string?
View 1 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
Mar 12, 2010
I use PuTTY to connect to an Ubuntu Server (VPS). I would like to use Tab-Completion when I'm working with the command line on Ubuntu Server... How can I configure it?
View 1 Replies
View Related
Nov 27, 2010
I am slowly rebuilding my network after a HDD crash that took out my primary development box. I installed Lucid Lynx and have things (mostly) working. The issue I am having has to do with file completion and history. I could set filec in my .cshrc file and it would work as it usually does (hit <TAB? key after typing in a couple of letters of a file name and BOOM the file auto-completes). For some reason, when I do the same thing, I get a literal TAB entered on the line. Also, if I attmept to utilize history (either the up-arrow from the keyboard I see ^[ instead of the last executed command(s).
View 2 Replies
View Related
Nov 30, 2010
When I add a new user and SSH to my server as that new user, my command prompt is just a '$'. Tab completion doesn't work either. What I notice is that I get this:
Could not chdir to home directory /home/scaldwell: No such file or directory
$
Echo PS1 yields nothing. There is also nothing in /etc/skel. I didn't have to do anything special to get my initial user setup with the right prompt, and the second user has been added to the admin group as well. I have noticed that if I issue the command sudo chsh -s /bin/bash the account gets the correct prompt.
View 1 Replies
View Related
Jun 20, 2010
I looked on the net for such function or example and didin't find anything, thus after having made one i guess it would be legitimate to drop it to see what others thinks of it.
#!/bin/bash
addelementtoarray()
{
local arrayname=$1
[code]....
View 10 Replies
View Related
Feb 17, 2010
I am using Ubuntu 9.10. I was installing network simulator 2. After installation I get the following message.
Please put /home/administrator/Downloads/ns-allinone-2.34/bin:/home/administrator/Downloads/ns-allinone-2.34/tcl8.4.18/unix:/home/administrator/Downloads/ns-allinone-2.34/tk8.4.18/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.
[Code].....
My friend suggested that it is something to do with .bashrc file. I fund files like .bash.bashrc.
View 4 Replies
View Related
Jul 28, 2010
how to edit or add codes to ~/.bashrc?? and also what is this bashrc if anyone could explain... i have tried editing this bashrc without success... how to save the changes in bashrc...
View 5 Replies
View Related
Dec 28, 2010
I get the following error on editing my .bashrc file.How to fix it??
Code:
karthick@Ubuntu-desktop:~$ gedit .bashrc
(gedit:3934): GLib-CRITICAL **: g_bookmark_file_load_from_data: assertion `length != 0' failed
[Code]....
View 4 Replies
View Related
Jun 20, 2011
I have what I hope is a fairly simple question to answer. In my ~/.bashrc file I can create this alias:
Code:
alias uChmodDP='chmod -R $1 $2' #specify permissions. and the variables work fine. But I cannot seem to get any love from this alias:
Code:
alias umnt='umount /dev/$1' I realize the likely problem is the variable following hot on the heels of a specific directory, but is there anyway to specify a variable in an alias like this? For some reason I cannot umount usb pen drives by right clicking, and have to always resort to the terminal to do so, which for me is no real biggie, but if I could create this alias it would be an even better no biggie to umount using the terminal.
Actually, the inability to right click to umount usb devices seems to be a Thunar issue since I run xubuntu. Using Nautilus I am able to right click and eject/safely remove devices. Using Thunar however, right click unmount always pukes back an error that the device must have been mounted on the command line or some such BS. But like I said it is no real biggie to use terminal, but an alias would be even nicer. I prefer using Thunar and Xubu most of the time b/c my laptop is quite underpowered.
View 3 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
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
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