Timeline for How should I replace a value in JSON file with its md5 value using jq command?
Current License: CC BY-SA 4.0
16 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 19, 2020 at 8:59 | comment | added | LuFFy | Got it working, had some junk space issue. | |
| May 19, 2020 at 8:59 | vote | accept | LuFFy | ||
| May 19, 2020 at 8:57 | comment | added | LuFFy |
@Inian Output : input.log: ASCII text
|
|
| May 19, 2020 at 7:16 | comment | added | Inian |
@LuFFy: Problem is with your input file. Post the output of file input.log
|
|
| May 19, 2020 at 7:15 | comment | added | LuFFy | I am using MobXterm, Am I missing something ? | |
| May 18, 2020 at 11:52 | comment | added | Inian |
Where are you running this script? Linux or DOS? Can you post the output of file input.log. I've tested the command to run as expected. The file encoding in your input file seems to be causing these problems
|
|
| May 18, 2020 at 11:48 | comment | added | LuFFy |
dos2unix succeed and run script again and got same error.
|
|
| May 18, 2020 at 11:47 | comment | added | Inian |
@LuFFy: Run dos2unix input.log and re-run the command again
|
|
| May 18, 2020 at 11:47 | comment | added | LuFFy |
shell output thrown error as : line 1: $'\r': command not found
|
|
| May 18, 2020 at 11:37 | comment | added | Inian |
@Kusalananda: Yes may be an assoc. array with bash like map[number]=md5str could work, but since md5sum calculation is external, reconstruction is anyway going to be cumbersome
|
|
| May 18, 2020 at 11:35 | comment | added | Kusalananda♦ |
Slightly awkward while loop there. Would be better to call md5sum on each number and then somehow pair them up with jq. I started to look at that but ran out of time.
|
|
| May 18, 2020 at 11:33 | history | edited | Inian | CC BY-SA 4.0 |
added 3 characters in body
|
| May 18, 2020 at 11:23 | history | edited | Inian | CC BY-SA 4.0 |
added 5 characters in body
|
| May 18, 2020 at 11:22 | comment | added | Inian | @LuFFy: in the first line, Instead of json replace your filename | |
| May 18, 2020 at 11:21 | comment | added | LuFFy |
where should I pass input file name ? can you mention input.log
|
|
| May 18, 2020 at 11:17 | history | answered | Inian | CC BY-SA 4.0 |