سؤال

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