i know you can set grep color defaults using the environment variables $GREP_OPTIONS and $GREP_COLOR, but i can't seem to find any way to set the default color options with pcregrep...
i have export GREP_OPTIONS='--color=auto' and export GREP_COLOR='31' in my /etc/profile right now, and want to have equivalent defaults for pcregrep.
tldr: how do i make pcregrep color matches by default?
i never did figure out how to do exactly what i wanted, but i got the same end result using an alias:
alias pcregrep='pcregrep --color=auto'
Related
I'm using oh-my-zsh. My theme file looks like this:
PROMPT="${AWS_PROFILE}%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
PROMPT+=' %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
It's based on a popular theme. The only thing I have added is ${AWS_PROFILE}.
The prompt does show my AWS profile as intended. But even if I the environment variable changes the prompt doesn't change. This is not as I had intended. It does change if I run source ~/.zshrc.
Can I make the prompt update when my env variable changes?
Copying #chepner's comment into an answer:
AWS_PROFILE is expanded immediately when you define PROMPT, since you used double quotes. Use single quotes, or consider using a precmd hook to set the value of PROMPT.
I want 'view source' in the browser to show the kind of HTML that would be created by running slimrb from the command line with the -p option.
You can configure Slim to always pretty print your HTML output using the :pretty option, which defaults to false. Using Rails, the easiest place to set this would likely be in an environment file.
From the docs, they show this example adding this code to config/environments/development.rb:
# Indent html for pretty debugging and do not sort attributes
Slim::Engine.set_options pretty: true, sort_attrs: false
Note that using this option is slower (per the documentation), so you'll probably only want to do this in your development environment, as in the example.
When I call oninit -i command in an Ubuntu server terminal, it shows an error like this:
INFORMIXSERVER does not match DBSERVERNAME or any of the DBSERVERALIASES.FAILED
Can anyone give me a solution for this problem?
What is the setting of $INFORMIXSERVER in your environment, and what values are set for DBSERVERNAME and DBSERVERALIASES in the $ONCONFIG file? It seems that you've set $INFORMIXSERVER to a value that isn't present in the $ONCONFIG file that is in use. Maybe you didn't set $ONCONFIG at all, or maybe you set $INFORMIXSERVER incorrectly, or maybe the names in the $ONCONFIG file are incorrect.
If you don't set $ONCONFIG, it defaults to onconfig (and maybe even falls back to onconfig.std). But you should normally set $ONCONFIG to a known value. I usually use onconfig.<servername> where the <servername> is the value of DBSERVERNAME in the file. However, nothing enforces that convention.
http://www.ibm.com/developerworks/data/library/techarticle/dm-0606bombardier/ is a good tutorial for setting up informix DB, I came up with same issue since my rootdbs file was owned by 'root', not by 'informix', make sure all file that are mentioned in the above tutorial to be owned by user 'informix' are correctly owned.
Basically, I know I can go through my control panel and modify the path variable. But, I'm wondering if there is a way to through batch programming have a temporary path included? That way it is only used during that batch file execution. I don't want to have people go in and modify their path variables just to use my batch file.
Just like any other environment variable, with SET:
SET PATH=%PATH%;c:\whatever\else
If you want to have a little safety check built in first, check to see if the new path exists first:
IF EXIST c:\whatever\else SET PATH=%PATH%;c:\whatever\else
If you want that to be local to that batch file, use setlocal:
setlocal
set PATH=...
set OTHERTHING=...
#REM Rest of your script
Read the docs carefully for setlocal/endlocal , and have a look at the other references on that site - Functions is pretty interesting too and the syntax is tricky.
The Syntax page should get you started with the basics.
There is an important detail:
set PATH="C:\linutils;C:\wingit\bin;%PATH%"
does not work, while
set PATH=C:\linutils;C:\wingit\bin;%PATH%
works. The difference is the quotes!
UPD also see the comment by venimus
That's right, but it doesn't change it permanently, but just for current command prompt.
If you wanna to change it permanently you have to use for example this:
setx ENV_VAR_NAME "DESIRED_PATH" /m
This will change it permanently and yes, you can overwrite it in another batch script.
Is there a way to set up certain defaults in the debugger? I'm not finding a way to do this..
create the file ~/.rdebugrc
add this:
set autolist
set autoeval
set autoreload
credit to (and more info) here: http://pivotallabs.com/users/chad/blog/articles/366-ruby-debug-in-30-seconds-we-don-t-need-no-stinkin-gui-