Difference between "Command substitution" and "Process substitution"
Hi,
What is the actual difference between these two? Why the following code works for process substitution and fails for command substitution?
executes successfully and display the contents of the file
But,
gives error as: bash: $(cat file): ambiguous redirect (same results for backticks syntax instead of "$()")
Also, please clarify to me whether 'IFS' is really required in this while loop as it seems to be redundant because by default read command will fetches the entire line if only one argument is supplied and no delimiter is needed here to print every line???
Is there any use case(s) available that the IFS presence is mandatory to print each and every line of a file?
Last edited by royalibrahim; 12-15-2008 at 10:00 AM..
$(...) means execute the command ... and print the output
to the command line.
<(...) and =(...) create a temporary file of the output and
redirect the output of this to the command line.
To understand the difference try:
and
The first will fail as diff expects input from a file.
Hi 2 all,
i have had AIX 7.2
:/# /usr/IBMAHS/bin/apachectl -v
Server version: Apache/2.4.12 (Unix)
Server built: May 25 2015 04:58:27
:/#:/# /usr/IBMAHS/bin/apachectl -M
Loaded Modules:
core_module (static)
so_module (static)
http_module (static)
mpm_worker_module (static)
... (3 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Please show me how to make substitution over the contents of a file in a perl script.
In a perl script, the core part of substitution operation is
s/FINDPATTERN/REPLACEPATTERN/g;
However, I cannot figure out how to make the substitution occur over the contents of a file. The following... (3 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hi,
could someone pls enlighten me on the difference between the "root" package and "usr" package?
Like in this example:
pkginfo -l SUNWGtku | grep -i desc
DESC: GTK - The GIMP Toolkit (Usr)
and
pkginfo -l SUNWGtkr | grep -i desc
DESC: GTK - The GIMP Toolkit (Root)... (6 Replies)
Can someone tell me how to get the version of bash that I am running?
I'm running cygwin bash on Windows XP at home and cygwin bash on Vista at work.
Is this the version number for bash?
$ uname -a
CYGWIN_NT-6.0 US-SEA-L3BER9K 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin
This is the... (2 Replies)
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)