Last active
          June 5, 2022 13:19 
        
      - 
      
- 
        Save 844196/e8f8986f48bb60ff8a0a to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | seq 100|sed 0~5cBuzz|sed 0~3s/[^B]*/Fizz/ | 
三項演算子を使った綺麗なFizzBuzz
for i in {1..100}; {(
    case $((i%3?i%5?4:2:i%5?1:3)) in
        1|3) v=Fizz;;&
        2|3) v+=Buzz;;
    esac
    echo ${v:-$i}
)}
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
最初に書いたやつ