Questions tagged [fd]

A user-friendly alternative to find command

Filter by
Sorted by
Tagged with
0
votes
2answers
98 views

Output tee to stdout while writing to a FD using here-strings

I am trying to output tee while writing to a custom file descriptor. Example: exec 4>"/tmp/testfile.txt"; # open FD 4 tee -a >&4 <<< "Output this to stdout" # ...
1
vote
1answer
70 views

Write multiple lines to file descriptor without here-doc and delete it after reading <&{fd} without blocking

#!/usr/bin/env bash auth() { exec 3<<AUTH $1 $2 AUTH } auth test pwd sh -c 'cat <&3' I want to temporarily store credentials in an auth file/mem of the format user/npass, which ...
0
votes
1answer
191 views

List all directories in home folder with fd

I'm trying to write a shell function to rapidly cd into any directory in my home folder, using the fd and fzf programs. This is what I have so far function fdcd() { cd "$(fd --type d --ignore-file ...
2
votes
1answer
129 views

How to determine if result of process substitution is a file path

If I do this: echo <(cat) I get: /dev/fd/63 so say at the command line I have: myapp -f <(cat) when I run it I get this error: You need to pass a file after the -f flag. The resolved ...
0
votes
0answers
84 views

bifurcate stdout - Send stdout to fd 3 if it's available

We want two stdout streams - one for data another for metadata - instead of sending metadata to stderr - we could send it a 4th fd (3). How would we do that? Here is a bad start: my_progam > <...
2
votes
1answer
98 views

Extract the number of pages of PDFs recursively and dump them to a CSV

I need to get a list of PDFs in various sub-folders of a directory structure and the number of pages of each PDF file. All saved into a CSV file, i.e. <filename>,<number_of_pages>. I have ...