On Wednesday, July 27, 2022 at 10:26:46 AM UTC-7, Pat wrote:
I have a Fortran 90 program that needs to run a bash command in it for text file manipulation.
Unfortunately the compiler gets confused between the "" for the command and the "" for the bash command
Example:
call execute_command_line("cat test.txt | awk '{$1=$NF=""; print $0}' > output.txt")
How do I fix this?
Thanks.Replace the two double quotes within the character literal constant with four double quotes: $NF=""""
I have a Fortran 90 program that needs to run a bash command in it for text file manipulation.
Unfortunately the compiler gets confused between the "" for the command and the "" for the bash command
Example:
call execute_command_line("cat test.txt | awk '{$1=$NF=""; print $0}' > output.txt")
How do I fix this?
Thanks.
call execute_command_line("cat test.txt | awk '{$1=$NF=""; print $0}' > output.txt")
Replace the two double quotes within the character literal constant with four double quotes: $NF=""""
On Wednesday, July 27, 2022 at 10:26:46 AM UTC-7, Pat wrote:
I have a Fortran 90 program that needs to run a bash command in it for text file manipulation.
Unfortunately the compiler gets confused between the "" for the command and the "" for the bash command
Example:
call execute_command_line("cat test.txt | awk '{$1=$NF=""; print $0}' > output.txt")
How do I fix this?
Thanks.
Replace the two double quotes within the character literal constant with four double quotes: $NF=""""
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 159 |
Nodes: | 16 (0 / 16) |
Uptime: | 98:40:33 |
Calls: | 3,209 |
Files: | 10,563 |
Messages: | 3,009,783 |