I want to run Mac & Ruby commands on the Power Shell, such as:

Asked 2 years ago, Updated 2 years ago, 78 views

ruby-e"l=STDIN.readlines; 10000.times {printl.sample}"<**file_name.csv**|wc-l

When I try to do this on the Power Shell, how should I describe it?

(Get-Content**file_name.csv** | ruby-e "l=STDIN.readlines; 10000.times {printl.sample};") .Length

I tried to write it like this, but I couldn't get any results.
Sorry for the beginner's question, but if anyone knows, please let me know.

ruby powershell

2022-09-30 19:26

1 Answers

There seems to be no space between ruby-e and ", which results in an error.

(Get-Content**file_name.csv** | ruby-e "l=STDIN.readlines; 10000.times {printl.sample};") .Length


2022-09-30 19:26

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.