* Simple Tip of the Day
@ 2005-12-01 20:38 zzapper
2005-12-02 1:09 ` Vincent Lefevre
0 siblings, 1 reply; 10+ messages in thread
From: zzapper @ 2005-12-01 20:38 UTC (permalink / raw)
To: zsh-users
Hi,
It can be very useful to set a "marker" variable when you are copying/comparing files in complicated
and different paths
eg in directory
>cd /xx/yy/ggg/ccc/
type
>S=`pwd`
Then from anywhere else you can type
>cp $S/somefile<TAB> .
Where the <TAB> indicates that all of zsh's completions work
A useful alias to automate this
alias SRC='S=`pwd`;echo "S=$S"'
--
zzapper
Success for Techies and Vim,Zsh tips
http://SuccessTheory.com/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Simple Tip of the Day
2005-12-01 20:38 Simple Tip of the Day zzapper
@ 2005-12-02 1:09 ` Vincent Lefevre
2005-12-02 9:13 ` Thorsten Kampe
0 siblings, 1 reply; 10+ messages in thread
From: Vincent Lefevre @ 2005-12-02 1:09 UTC (permalink / raw)
To: zsh-users
On 2005-12-01 20:38:16 +0000, zzapper wrote:
> >cd /xx/yy/ggg/ccc/
> type
> >S=`pwd`
You could use $PWD instead of `pwd`.
--
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Simple Tip of the Day
2005-12-02 1:09 ` Vincent Lefevre
@ 2005-12-02 9:13 ` Thorsten Kampe
2005-12-02 12:49 ` Mikael Magnusson
0 siblings, 1 reply; 10+ messages in thread
From: Thorsten Kampe @ 2005-12-02 9:13 UTC (permalink / raw)
To: zsh-users
* Vincent Lefevre (2005-12-02 01:09 +0100)
> On 2005-12-01 20:38:16 +0000, zzapper wrote:
>>>cd /xx/yy/ggg/ccc/
>> type
>>>S=`pwd`
>
> You could use $PWD instead of `pwd`.
Use zsh's autopushd option and refer to "S" as ~1 (or ~n). That's much
simpler.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Simple Tip of the Day
2005-12-02 9:13 ` Thorsten Kampe
@ 2005-12-02 12:49 ` Mikael Magnusson
2005-12-02 19:20 ` zzapper
0 siblings, 1 reply; 10+ messages in thread
From: Mikael Magnusson @ 2005-12-02 12:49 UTC (permalink / raw)
To: zsh-users
On 12/2/05, Thorsten Kampe <thorsten@thorstenkampe.de> wrote:
> * Vincent Lefevre (2005-12-02 01:09 +0100)
> > On 2005-12-01 20:38:16 +0000, zzapper wrote:
> >>>cd /xx/yy/ggg/ccc/
> >> type
> >>>S=`pwd`
> >
> > You could use $PWD instead of `pwd`.
>
> Use zsh's autopushd option and refer to "S" as ~1 (or ~n). That's much
> simpler.
I type ~- and then press tab to get a list of all the dirs i've been
in, and ~+ is the shortest alias for $PWD that i found.
--
Mikael Magnusson
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Simple Tip of the Day
2005-12-02 12:49 ` Mikael Magnusson
@ 2005-12-02 19:20 ` zzapper
2005-12-03 20:28 ` zzapper
0 siblings, 1 reply; 10+ messages in thread
From: zzapper @ 2005-12-02 19:20 UTC (permalink / raw)
To: zsh-users
On Fri, 2 Dec 2005 13:49:06 +0100, wrote:
>On 12/2/05, Thorsten Kampe <thorsten@thorstenkampe.de> wrote:
>> * Vincent Lefevre (2005-12-02 01:09 +0100)
>> > On 2005-12-01 20:38:16 +0000, zzapper wrote:
>> >>>cd /xx/yy/ggg/ccc/
>> >> type
>> >>>S=`pwd`
>> >
>> > You could use $PWD instead of `pwd`.
>>
>> Use zsh's autopushd option and refer to "S" as ~1 (or ~n). That's much
>> simpler.
>
>I type ~- and then press tab to get a list of all the dirs i've been
>in, and ~+ is the shortest alias for $PWD that i found.
kool
activate autopushd
> setopt autopushd pushdignoredups
>dirs -v
BTW I'm happer using S=~+ for my purpose as I know it won't move about
--
zzapper
Success for Techies and Vim,Zsh tips
http://SuccessTheory.com/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Simple Tip of the Day
2005-12-02 19:20 ` zzapper
@ 2005-12-03 20:28 ` zzapper
2005-12-03 22:08 ` Mikael Magnusson
0 siblings, 1 reply; 10+ messages in thread
From: zzapper @ 2005-12-03 20:28 UTC (permalink / raw)
To: zsh-users
On Fri, 02 Dec 2005 19:20:48 +0000, wrote:
>>I type ~- and then press tab to get a list of all the dirs i've been
BTW couldn't get this to work, what do I need to do?
--
zzapper
Success for Techies and Vim,Zsh tips
http://SuccessTheory.com/
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Simple Tip of the Day
2005-12-03 20:28 ` zzapper
@ 2005-12-03 22:08 ` Mikael Magnusson
2005-12-03 22:20 ` zzapper
0 siblings, 1 reply; 10+ messages in thread
From: Mikael Magnusson @ 2005-12-03 22:08 UTC (permalink / raw)
To: zsh-users
On 12/3/05, zzapper <david@tvis.co.uk> wrote:
> On Fri, 02 Dec 2005 19:20:48 +0000, wrote:
>
>
> >>I type ~- and then press tab to get a list of all the dirs i've been
>
> BTW couldn't get this to work, what do I need to do?
% zsh -f
% setopt autopushd
% autoload -U compinit
% compinit
% cd /
% cd /tmp
% cd ~-<tab>
0 -- /home/mikaelh
1 -- /
--
Mikael Magnusson
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Simple Tip of the Day
2005-12-03 22:08 ` Mikael Magnusson
@ 2005-12-03 22:20 ` zzapper
2005-12-04 0:24 ` compinit security (Re: Simple Tip of the Day) Bart Schaefer
2005-12-04 1:32 ` Simple Tip of the Day Mikael Magnusson
0 siblings, 2 replies; 10+ messages in thread
From: zzapper @ 2005-12-03 22:20 UTC (permalink / raw)
To: zsh-users
On Sat, 3 Dec 2005 23:08:34 +0100, wrote:
>On 12/3/05, zzapper <david@tvis.co.uk> wrote:
>> On Fri, 02 Dec 2005 19:20:48 +0000, wrote:
>>
>>
>> >>I type ~- and then press tab to get a list of all the dirs i've been
>>
>> BTW couldn't get this to work, what do I need to do?
>
>% zsh -f
>% setopt autopushd
>% autoload -U compinit
>% compinit
>% cd /
>% cd /tmp
>% cd ~-<tab>
>0 -- /home/mikaelh
>1 -- /
cd ~-<TAB> then type number of directory to cd to it!!!
Superkool,
but when I put this in my .zshenv it asks
ignore insecure directories and files and continue [ny]?
compinit: initialization aborted
how do I get it to default to y and what does insecure in this context mean?
--
zzapper
Success for Techies and Vim,Zsh tips
http://SuccessTheory.com/
^ permalink raw reply [flat|nested] 10+ messages in thread
* compinit security (Re: Simple Tip of the Day)
2005-12-03 22:20 ` zzapper
@ 2005-12-04 0:24 ` Bart Schaefer
2005-12-04 1:32 ` Simple Tip of the Day Mikael Magnusson
1 sibling, 0 replies; 10+ messages in thread
From: Bart Schaefer @ 2005-12-04 0:24 UTC (permalink / raw)
To: zsh-users
On Dec 3, 10:20pm, zzapper wrote:
}
} ignore insecure directories and files and continue [ny]?
} compinit: initialization aborted
}
} how do I get it to default to y
You can't, but you don't really want to. An answer of "n" means abort,
and an answer of "y" means to skip reading the insecure directories.
The compsys manual section says under "Initialization":
For security reasons compinit also checks if the completion system
would use files not owned by root or by the current user, or files
in directories that are world- or group-writable or that are not
owned by root or by the current user. If such files or directories
are found, compinit will ask if the completion system should really
be used. To avoid these tests and make all files found be used
without asking, use the option -u, and to make compinit silently
ignore all insecure files and directories use the option -i. This
security check is skipped entirely when the -C option is given.
In other words, it's paranoid about sourcing files that might have been
created or edited by a malicious third party.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Simple Tip of the Day
2005-12-03 22:20 ` zzapper
2005-12-04 0:24 ` compinit security (Re: Simple Tip of the Day) Bart Schaefer
@ 2005-12-04 1:32 ` Mikael Magnusson
1 sibling, 0 replies; 10+ messages in thread
From: Mikael Magnusson @ 2005-12-04 1:32 UTC (permalink / raw)
To: zsh-users
On 12/3/05, zzapper <david@tvis.co.uk> wrote:
> >% cd /
> >% cd /tmp
> >% cd ~-<tab>
> >0 -- /home/mikaelh
> >1 -- /
> cd ~-<TAB> then type number of directory to cd to it!!!
>
> Superkool,
>
> but when I put this in my .zshenv it asks
>
> ignore insecure directories and files and continue [ny]?
> compinit: initialization aborted
>
> how do I get it to default to y and what does insecure in this context mean?
It means some files somewhere have the wrong permissions, ie someone
other than you and root could write to them and run arbitrary code.
Check in $PREFIX/share/zsh/* and your .z* files, they should be 644 or
so. Maybe if you run with zsh -x it will print which file it is, not
sure.
--
Mikael Magnusson
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2005-12-04 1:33 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-01 20:38 Simple Tip of the Day zzapper
2005-12-02 1:09 ` Vincent Lefevre
2005-12-02 9:13 ` Thorsten Kampe
2005-12-02 12:49 ` Mikael Magnusson
2005-12-02 19:20 ` zzapper
2005-12-03 20:28 ` zzapper
2005-12-03 22:08 ` Mikael Magnusson
2005-12-03 22:20 ` zzapper
2005-12-04 0:24 ` compinit security (Re: Simple Tip of the Day) Bart Schaefer
2005-12-04 1:32 ` Simple Tip of the Day Mikael Magnusson
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).