Timeline for How can I keep an extracted value in a variable in bash
Current License: CC BY-SA 4.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Sep 28, 2021 at 10:14 | history | edited | Kusalananda♦ | CC BY-SA 4.0 | added 174 characters in body |
| Sep 28, 2021 at 10:02 | comment | added | Stéphane Chazelas | Note that echo can mangle data. Better to use printf. And awk processes one line at a time, so would be a problem with file names that contain newline characters. | |
| Sep 28, 2021 at 9:56 | comment | added | Kusalananda♦ | @NgouabaRosalie I would suggest you use the variable substitution method that I showed first in my answer instead of using awk for this. It is slow to run awk like this in a loop, and you will find that your code runs many times faster when using the variable substitution. | |
| Sep 28, 2021 at 9:53 | comment | added | Ngouaba Rosalie | I just needed to add echo before "$file" as you said. Thanks so much. it works perfectly now. | |
| Sep 28, 2021 at 9:47 | history | edited | Kusalananda♦ | CC BY-SA 4.0 | added 209 characters in body |
| Sep 28, 2021 at 9:36 | history | answered | Kusalananda♦ | CC BY-SA 4.0 |