Handling files with CRLF line ending

2022-12-03 Thread Yair Lenga
Hi, I was recently asked to deploy a bash/python based solution to windows (WSL2). The solution was developed on Linux. Bash is being used as a glue to connect the python based data processing (pipes, files, ...). Everything works as expected with a small BUT: files created by python can not be

`declare -f' does not output the "function" keyword when required

2022-12-03 Thread Emanuele Torre
In Bash, it is possible to define functions that look like assignment words using the function keyword: function a=2 { printf hi\\n ;} When `declare -f' is used to output all the function definitions, bash will not output that function definition with the "function" keyword, generating

`declare -f "a="' fails unnecessarily

2022-12-03 Thread Emanuele Torre
`declare -f "something="' fails with the following error: $ declare -f 'a=x' bash: declare: cannot use `-f' to make functions $ f=a=x $ decalre -f -- "$f" bash: declare: cannot use `-f' to make functions That error is not very useful. Bash makes `declare -f' fail with that

Re: Handling files with CRLF line ending

2022-12-03 Thread Greg Wooledge
On Sat, Dec 03, 2022 at 05:40:02AM -0500, Yair Lenga wrote: > I was recently asked to deploy a bash/python based solution to windows > (WSL2). The solution was developed on Linux. Bash is being used as a glue > to connect the python based data processing (pipes, files, ...). Everything > works as

Re: Handling files with CRLF line ending

2022-12-03 Thread Yair Lenga
Thank you for suggestions. I want to emphasize: I do not need help in striping the CR from the input files - it's simple. The challenge is executing a working bash/python solution from Linux on WSL, with MINIMAL changes to the scripts. Specifically in my case, the owners of the various modules