Menu
  • HOME
  • TAGS

How to get shell expansion on scala sys.process invocations

scala,process,expansion

I fear you took my answer the wrong way. Ruby is doing the same thing, and I know this without looking at their code because what Java (and, by extension, Scala) presents as API is a direct translation of the Unix API. It is shell that does shell expansions, and...

How to get fully expanded gnu make variable value

variables,macros,make,expand,expansion

You are explicitly telling make to NOT expand the variable, by using the $(value $(V)) construct. That's what the value function does: avoids expansion. If you want expansion, get rid of the value function. Why did you add it there in the first place? GENVARS1 = $(foreach v,$(1),set $(v) $(call...

Do we need to call wordfree upon wordexp failure?

c,posix,expansion

According to the GNU's manual example, it should be called on error only if WRDE_NOSPACE was returned: switch (wordexp (program, &result, 0)) { case 0: /* Successful. */ break; case WRDE_NOSPACE: /* If the error was WRDE_NOSPACE, then perhaps part of the result was allocated. */ wordfree (&result); default: /*...

Makefile Secondary Expansion

makefile,gnu,expansion

The manual is misleading, possibly due to a typo. The first of the two sentences: The $$< variable evaluates to the first prerequisite in the first rule for this target. $$^ and $$+ evaluate to the list of all prerequisites of rules that have already appeared for the same target...

Simple ZSH function and files with spaces in their name

whitespace,filenames,zsh,expansion

The shell performs parameter substitution and word-splitting in this order. This means you eventually execute vim /home/username/Dropbox/20150209-132501-Recx-new note today.md.md I.e. you call vim with three file names. If you want to suppress word-splitting on the substituted part, you must use quotes in the function definition as well: function note() {...

why does the xslt variable not expand?

variables,xslt,expansion

The XPath expression to extract the value of a variable is $variableName with no quotes, but the question is which places in the stylesheet are interpreted as XPath expressions and which aren't. In attribute values on literal result elements you can include XPath expressions in braces and they will be...

Generate All Possible Matches of a Regular Expression [closed]

c++,string,algorithm,expansion,string-interpolation

Your steps are pretty straight forward though implementing them may take a bit of work: Create a recursive function which extracts the string between the first set of parenthesis it comes to: http://stackoverflow.com/a/28863720/2642059 In the function split this strings on ',' into a vector<string> and return it: http://stackoverflow.com/a/28880605/2642059 Before returning...

Linux: access previously used Directory

linux,directory,environment-variables,expansion

!$ is replaced by the last argument of the previous command line, so executing cd !$ after the ls command above will execute cd /bin. I don't know of an easy way to refer to the next-to-last argument, but you can refer to arguments by index with the syntax !:n,...

REST API considerations for expansion in the future

java,api,rest,expansion

You almost got it right. The problem with your approach is that it's pretty easy to spoof the application id, especially when it does not expire. The way it usually works, each app which accesses your service would have an Application Key, and Application Secret. You use app key to...

How to iterate through string one word at a time in zsh

bash,while-loop,zsh,expansion

In order to see the behavior compatible with Bourne shell, you'd need to set the option SH_WORD_SPLIT: setopt shwordsplit # this can be unset by saying: unsetopt shwordsplit things="one two" for one_thing in $things; do echo $one_thing done would produce: one two However, it's recommended to use an array for...

Expanding a text with backspace at the end

text,autohotkey,symbols,expansion,backspace

Put an O in the options between the first two colons: :O:sq::start quote" From the help: O: Omit the ending character of auto-replace hotstrings when the replacement is produced. This is useful when you want a hotstring to be kept unambiguous by still requiring an ending character, but don't actually...

Can not upload new main expansion file to Google Play console

android,upload,expansion

Not knowing the reason, I found that the main expansion file uploading was enabled again after 2 days.

Avoiding expansion when looping: for x in $foo

bash,shell,for-loop,wildcard,expansion

The solution to this should not under any circumstance involve ls. You can iterate the files with a for-loop and use an -x test to determine if files are executable. However, directories are usually executable too (if they're not, you cannot enter them, e.g. with cd), so depending on whether...

How to use delayed expansion with the iterator of the outer for-loop?

batch-file,for-loop,delay,expansion

To correct the error, it is necessary to add a space between the do clause and the opening parenthesis of the code block. The %%s replaceable parameter scope/visibility is anywhere inside the for loop that initializes it. So, it can be directly used inside the inner loop....