New answers tagged

1

In vim, or with vi on a BSD system: Use the vi command :0r !hostname Or, in its longer form, :0read !hostname You would have to press Esc first, of course. The read command usually takes a filename and inserts the contents of that file beneath the current line, but if you specify a shell command with ! in front of it, it will take the output from ...


1

You tagged vi however it sounds like you're looking for a CLI option. While in vi you can use shift + O to insert above and automatically add a new line and just paste your line right in. If you don't want to use an editor you can use sed. sudo sed -i '1iabcd555.india.com' /etc/hosts


1

Would this work using sed? sed -i '1 i\'$HOSTNAME'' file Using this with a file named test1 produces: $ cat test1 one two three four five Then: $ sed -i '1 i\'$HOSTNAME'' test1 leads to: $ cat test1 chris-dell one two three four five


0

The easiest way to do this programmatically is to write to a temporary file and then overwrite the existing one: { printf '%s\n' "$(hostname)"; cat somefile } > somefile.tmp mv somefile.tmp somefile


0

Can python stdlib files be directly edited? Yes, generally, although some of them are compiled C extensions, which you won't be able to. Can you run Visual Studio as root? I'm not sure, but it's such a complicated program that's it's probably a better idea, from a security perspective, not to. Anyways, using sudo for gui programs can cause all sorts of ...


1

perl -l0 -ne 'print for /\\subimport\{\}\{(.*?)\}/g' file.tex Would print the filenames inside those \subimport{}{...} functions NUL-delimited. You can pipe that to xargs -0 grep -l gastric -- to find which of those files contain gastric.


0

In the end, I use the search in directory by the script here with a redirection to Vim. It would be great to get something like that work in Geany IDE directly.


1

It turns out, the latter command follows whatever is set in $EDITOR, e.g., doing: EDITOR=editor FCEDIT=editor editor(){ vim +'set ft=sh' "$@"; } Will cause vim, defaulting to sh syntax, to open for both v presses in command mode and for fc. Edit: Thanks to alexander-batischev for pointing out that EDITOR=editor editor(){ vim +'set ft=sh' "$@"; } is ...


1

Edited as the user needs: cat document.tex | cut -d'{' -f3 | cut -d'}' -f1 | while read file grep -i 'gastric' "$file" &>/dev/null && echo "$file contains gastric" done


1

CLTM might be required if your corporate proxy uses NTLM from Microsoft. After you have cntlm proxy server configured for upstream proxy (which is your corporate proxy), just configure npm to use it: npm config set proxy http://127.0.0.1:3128 npm config set https-proxy http://127.0.0.1:3128 You must have both http and https. Most package managers work ...


2

According to the npm config help, it will only derive its proxy settings from the environment If the HTTPS_PROXY or https_proxy or HTTP_PROXY or http_proxy environment variables are set (from the https_proxy section, the proxy section only mentions HTTP_PROXY and http_proxy). The help also doesn't list all_proxy as a configuration key anywhere, just ...


3

If you go to the package AUR page and View Changes, you can see that in the most recent commit one of the version numbers was increased, but that file's corresponding md5sum didn't change. # Module Versions _about_arch_url="fusion809/about" -_about_arch_ver=1.5.17 +_about_arch_ver=1.5.18 _dark_bint_syntax_ver=0.8.6 _fusion_ui_ver=0.10.5 ...



Top 50 recent answers are included