Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

process substitution <() bash

Process substitution feeds the output of a process (or processes)
into the stdin of another process

Because pipes create a new shell, $count wont be assigned
$ cat file | while read line; do ((count++)); done
$ echo $count

We can however use process subsititution to work around this:
$ while read line; do ((count++)); done < <(cat file)
$ echo $count  # the variable *does* exist in the current shell
Comment

PREVIOUS NEXT
Code Example
Shell :: install maven on linux 
Shell :: powershell unzip file 
Shell :: bash: yarn: command not found 
Shell :: vim hangs 
Shell :: how to Install nodejs on a chromebook 
Shell :: npm install redux form 
Shell :: clear pacman cahce 
Shell :: phoneinfoga github 
Shell :: how to get hostname on linux 
Shell :: odd even in shell script 
Shell :: react native expo install 
Shell :: ufw enable 
Shell :: git set upstream 
Shell :: bash: /var/lib/snapd/snap/bin/docker-compose: No such file or directory 
Shell :: bash firebase command not found 
Shell :: ubuntu install Tesseract OCR 
Shell :: docker start all containers 
Shell :: checkbox github markdown 
Shell :: save account to git 
Shell :: kali linux virtualbox password 
Shell :: how to install mysql python 
Shell :: openssh client for windows 10 
Shell :: install edge on ubuntu 
Shell :: kubectl connect eks 
Shell :: sudo kill port windows 
Shell :: how to save windows spotlight images 
Shell :: install classnames 
Shell :: how to change permissions for the whole folder in ubuntu 
Shell :: device manager cmd command 
Shell :: ubuntu fingerprint sudo 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =