You are not logged in.

#1 2007-07-27 13:35:37

iggy
Member
From: Germany, L.E. - Leipzig
Registered: 2004-10-17
Posts: 367

zsh: "set | grep foo" show my not the result...

hello!

i have "successfully" switched to zsh! i must say: its amazing!!!

but i have one problem: i often use commands like this:

$ set | grep foo

but i get this:
hit:

$ set | grep foo
Binary file (standard input) matches

no hit:

$ set | grep foo

what i have to change in the .zshrc to get the lines where the word is included?

here is my config:

# history
HISTSIZE=1000
SAVEHIST=1000
HISTFILE=$HOME/.zsh_history
setopt append_history
setopt no_hist_beep
setopt hist_ignore_space
setopt hist_ignore_all_dups # prevent duplicated entries

# colors and prompt shells
autoload colors zsh/terminfo
    if [[ "$terminfo[colors]" -ge 8 ]]; then
   colors
    fi
    for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
   eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
   eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
   (( count = $count + 1 ))
    done
    PR_NO_COLOR="%{$terminfo[sgr0]%}"
#PS1="[$PR_BLUE%n$PR_WHITE@$PR_GREEN%U%m%u$PR_NO_COLOR:$PR_RED%2c$PR_NO_COLOR]%(!.#.$) "
PS1="[%{$PR_GREEN%}%n%{$PR_WHITE%}@%m%u %{$PR_BLUE%}%2c%{$PR_NO_COLOR%}]%(!.#.$) "
RPS1="$PR_LIGHT_YELLOW(%D{%d-%m-%y %H:%M})$PR_NO_COLOR"

# advanced tab-completion
autoload -U compinit
compinit
zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
zstyle ':completion:*:warnings' format '%BSorry, no matches for: %d%b'
zstyle ':completion:*' menu select interactive # shows menu which you can browse with arrow keys

# tab completion for "kill"
zstyle ':completion:*:kill:*' menu yes select
zstyle ':completion:*:kill:*' force-list always
zstyle ':completion:*:processes' command 'ps x'

# tab completion for "man"
zstyle ':completion:*:manuals' menu yes select

# colors in completion
#eval $(dircolors)
#zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}

# command correction
setopt correctall

# auto change directory ( "/etc" instead of "cd /etc" )
setopt autocd

# other options
unsetopt bgnice autoparamslash

# key bindings
typeset -g -A key
bindkey '^[OH' beginning-of-line # pos1 key
bindkey '^[OF' end-of-line # end key
bindkey '^[[3~' delete-char # del key
bindkey '^[[6~' down-line-or-history # page down key
bindkey '^[[5~' down-line-or-history # page up key

thx, iggy


sorry for my bad english smile

Offline

#2 2007-07-27 13:43:33

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: zsh: "set | grep foo" show my not the result...

I don't know much about zsh, but wouldn't

echo $foo

work just as well?

-edit-

Actually, you might be able to use the following bash-isms:

$ # To display variables
$ declare -p VARNAME   
$ # To display functions
$ declare -f functname

Last edited by Cerebral (2007-07-27 13:54:56)

Offline

#3 2007-07-27 15:03:41

F
Member
Registered: 2006-10-09
Posts: 322

Re: zsh: "set | grep foo" show my not the result...

try this instead:

$ set | strings | grep foo

Offline

Board footer

Powered by FluxBB