In this reST example meant to be rendered by Sphinx, |yaco_url| doesn't get replaced because it's in a code-block:
.. |yaco_url| replace:: http://yaco.es/
You can use wget to download it:
.. code-block:: console
$ wget…
I'm trying to retrieve entries from a python dictionary in jinja2, but the problem is I don't know what key I want to access ahead of time - the key is stored in a variable called s.course. So my problem is I need to double-substitute this variable.…
I use GVim on Windows 7.
I want to learn how to put newline characters by using regex substitutions. To do this I try to use \r and \n metacharacters but the substituted text doesn't show normal newlines.
For example, at the beginning I have:
line…
I get a lot of database information from clients in excel spreadsheets. I frequently need to insert/update this data back into the database.
I often use excel to generate the insert and update statements via concatenating a bunch of cells together.…
I basically want to do this:
cat file | grep '' | sed 's///g'
without having to write the expression twice:
cat file | sed 's///g'
Is there a way to tell sed not to print lines that…
I have a bunch of sass files and my designer used the wrong syntax. I wanted :margin-top 1px but he did margin-top: 1px
So I easily wrote a sub command:
:rubydo sub! /([\w-]+):/,':\1'
So that works and fixes all the colons and moves them in the…
I am trying to set up a function to reformat a string that will later be concatenated. An example string would look like this:
Standard_H2_W1_Launch_123x456_S_40K_AB
Though sometimes the "S" doesn't exist, and sometimes the "40K" is "60K" or not…
A contrived example... given
FOO="/foo/bar/baz"
this works (in bash)
BAR=$(basename $FOO) # result is BAR="baz"
BAZ=${BAR:0:1} # result is BAZ="b"
this doesn't
BAZ=${$(basename $FOO):0:1} # result is bad substitution
My question is which…
I'm new to shell programming. I intend to get directory name after zip file was extracted. The print statement of it is
$test.sh helloworld.zip
helloworld
Let's take a look at test.sh:
#! /bin/sh
length=echo `expr index "$1" .zip`
a=$1
echo…
I am using Sphinx to document a webservice that will be deployed in different servers. The documentation is full of URL examples for the user to click and they should just work. My problem is that the host, port and deployment root will vary and the…
Sometimes in Python scripts I see lines like:
cmd = "%s/%s_tb -cm cond+line+fsm -ucli -do \"%s\""
Where is the %s in the above line substituted? Does Python have some stack of strings and it pops them and replaces %s?
I saw other questions dealing with the finding the n-th occurrence of a word/pattern, but I couldn't find how you would actually substitute the n-th occurrence of a pattern in vim. There's the obvious way of hard coding all the occurrences like…
I would like use a function that uses the standard deparse(substitute(x)) trick within lapply. Unfortunately I just get the argument of the loop back. Here's my completely useless reproducible example:
# some test data
a <- 5
b <- 6
li <-…