Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 1
    This won't fix the issue you're having, but it is far safer and better to use for file in id_rsa* instead of ls | while. Commented Mar 24, 2021 at 17:37
  • @terdon, the drawback with the for approach is that it will take both id_rsa and id_rsa.pub files. This approach requires adding a if statement to skip the loop for the id_rsa.pub Commented Mar 25, 2021 at 1:40
  • find $rsa_dir ! -iregex '.*\.pub$'-print0 | xargs -0 ... or | while read file Commented Mar 26, 2021 at 21:45