문제

How would you write the equivalent script in fish

#!/bin/bash
for i in `ls`
do
  echo $i
done

Thank you

도움이 되었습니까?

해결책

fish uses ( parens ) rather than backticks for capturing shell output:

for i in (ls)
  echo $i
end
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top