bash - Which file descriptors (/dev/fd/##) are used in process substitution? - Ask Ubuntu


i have program takes 2 inputs:

my_program --input1 {videofile1} --input2 {videofile2} 

i want redirect inputs through process substitution (because inputs large video files, want transcode on-the-fly). through experiment, i'm using following, functionally fine:

my_program --input1 /dev/fd/63 --input2 /dev/fd/62 <( {video transcoding command 1} ) <( {video transcoding command 2} ) 

my question : why file descriptor numbers 63 , 62? guaranteed take values, or system-dependent?

apologies if well-documented, can't find in searches far.

thanks time!

videoprocessing wellknown seeking file. means cannot use stream input. , if using output program, stream - no matter whether use pipes or fds.

but maybe in luck your program can use pipes. in case should fine:

my_program --input1 <( {video transcoding command 1} ) --input2 <( {video transcoding command 2} ) 

the <() may if giving on stdin < does. not. instead substituted link pipe:

$ echo <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) <(true) /dev/fd/63 /dev/fd/62 /dev/fd/61 /dev/fd/60 /dev/fd/59 /dev/fd/58 /dev/fd/57 /dev/fd/56 /dev/fd/55 /dev/fd/54 /dev/fd/53 /dev/fd/52 /dev/fd/51 /dev/fd/50 /dev/fd/49 /dev/fd/48 /dev/fd/47 /dev/fd/46 /dev/fd/45 /dev/fd/44 /dev/fd/43 /dev/fd/42 /dev/fd/41 /dev/fd/40 /dev/fd/39 /dev/fd/38 /dev/fd/37 /dev/fd/36 /dev/fd/35 /dev/fd/34 /dev/fd/33 /dev/fd/32 /dev/fd/31 /dev/fd/30 /dev/fd/29 /dev/fd/28 /dev/fd/27 /dev/fd/26 /dev/fd/25 /dev/fd/24 /dev/fd/23 /dev/fd/22 /dev/fd/21 /dev/fd/20 /dev/fd/19 /dev/fd/18 /dev/fd/17 /dev/fd/16 /dev/fd/15 /dev/fd/14 /dev/fd/13 /dev/fd/12 /dev/fd/11 /dev/fd/10 /dev/fd/9 /dev/fd/8 /dev/fd/7 /dev/fd/6 /dev/fd/5 /dev/fd/3 /dev/fd/4 /dev/fd/64 /dev/fd/65 /dev/fd/66 /dev/fd/67 $ ls -l <(true) lr-x------ 1 tange tange 64 nov 12 07:59 /dev/fd/63 -> pipe:[1200523] 

so may in situations makes sense:

$ cmd 2> >(cmd2) | cmd3 

Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User