Skip to content

documentation on using nmem in WSL uses wong cli code example #130

@fniu

Description

@fniu

Describe the bug
The example cli code used in the following link doesn't work:

https://mem.nowledge.co/docs/troubleshooting#using-nmem-from-wsl

mkdir -p ~/.local/bin && cat > ~/.local/bin/nmem << 'SHIMEOF'
#!/bin/bash
q=""; for a in "$@"; do q="$q \"$a\""; done
cmd.exe /s /c "\"nmem.cmd\"$q"
SHIMEOF
chmod +x ~/.local/bin/nmem

To Reproduce
Run the given code in WSL bash, one get the following error:

Describe the bug
The example cli code used in the following link doesn't work:

https://mem.nowledge.co/docs/troubleshooting#using-nmem-from-wsl

mkdir -p ~/.local/bin && cat > ~/.local/bin/nmem << 'SHIMEOF'
#!/bin/bash
q=""; for a in "$@"; do q="$q \"$a\""; done
cmd.exe /s /c "\"nmem.cmd\"$q"
SHIMEOF
chmod +x ~/.local/bin/nmem

To Reproduce
Run the given code in WSL bash, and then run nmem status, got:

$ nmem status
'\wsl.localhost\Ubuntu-22.04\home<username>'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
'"nmem.cmd"' is not recognized as an internal or external command,
operable program or batch file.

Instead, the following code works for me:

mkdir -p ~/.local/bin && cat > ~/.local/bin/nmem << 'EOF'
#!/usr/bin/env bash
cd /mnt/c || exit 1
exec cmd.exe /c nmem.cmd "$@"
EOF
chmod +x ~/.local/bin/nmem

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions