Questions about shell command substitution (such as $(command) or `command`), its mechanism, correct syntax etc. Not to be confused with aliasing.

learn more… | top users | synonyms

1
vote
2answers
42 views

How do I create a rule for custom flag replacement with C shell?

I want to have the following behavior with grep: grep --java <rest of the command> Where --java would either dynamically convert to --include=*.java or internally be equivalent to it. Is ...
1
vote
1answer
30 views

Command substitution

I would like to create a script on SUSE Enterprise Linux, it first asks for a string (representing a date) and then search for all files in a certain directory which contains the string in its ...
2
votes
0answers
23 views

bash/cygwin broken after installing rtool?

Usually I can solve problems on my own (and Google). But recently I am baffled by this strange hiccup. Background: I use a chain of scripts for file-processing (in Windows, under Cygwin. Scripts ...
0
votes
0answers
47 views

How to write into local file and set its content to a variable within a ssh command substitution

I would like to write on local file (or local variable if better) and set its content to a variable within a ssh command substitution. Here is my code : REMOTE_OUTPUT=$(ssh remote@server /bin/bash ...
0
votes
0answers
109 views

Why is a here-string command substitution considered as a single line?

I'm experimenting with while read syntax and there is a thing I don't understand. The most basic scenario which reproduces the problem is the following: a bash script a.sh calls another script b.sh ...