dsherret / dax

Cross-platform shell tools for Deno and Node.js inspired by zx.
MIT License
965 stars 33 forks source link

built-in 'cat' command does not work with absolute paths #247

Closed lichwala closed 4 months ago

lichwala commented 4 months ago

Node.js version of dax.

...
"devDependencies": {
    "dax-sh": "^0.39.1"
  }
...

This works fine (it takes os-based 'cat' command):

const output = await $`/usr/bin/cat /var/log/nginx/access.log | wc -l`.text()
$.log(output)

output:

1385

but this one fails (it takes built-in 'cat' command):

const output = await $`cat /var/log/nginx/access.log | wc -l`.text()
$.log(output)

output:

cat /var/log/nginx/access.log: no such file or directory, open '/home/pi/dax/var/log/nginx/access.log'
0