Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Watch for undocumented behavior of cp -R' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Watch for undocumented behavior of cp -R
Authored by: greed on Nov 16, '05 09:17:56AM

Switch to the Z shell and tell it "setopt autoremoveslash". That way, when you tab-complete a directory, it removes the trailing slash when you hit the next key. (Hit slash then tab to accept the directory and start completing stuff inside it.)

I can't find a similar option in BASH.

You will find a similar trailing-slash convention used in rsync.



[ Reply to This | # ]
omitting trailing slash on completion
Authored by: sjk on Nov 21, '05 03:03:05PM

Adding "set mark-directories off" to ~/.inputrc will omit the trailing slash from directory completion in bash and other apps that use the readline library for completion.

In tcsh, add "unset addsuffix" to ~/.tcshrc or wherever you put commands that it processes shell variables. My ~/.tcshrc file has this line in it:

if (-r /usr/share/tcsh/examples/rc) source /usr/share/tcsh/examples/rc

... so I put "unset addsuffix" in ~/Library/init/tcsh/rc.mine along with other commands that override and extend the rc examples.



[ Reply to This | # ]