Skip to main content
added 1 character in body
Source Link
vnp
  • 58.7k
  • 4
  • 55
  • 144
  • tail must to read the whole file. Calling sort with a -r (aka --reverse option) you can use head instead.

  • touch takes multiple arguments. You may

      touch $DIRNAME/first.txt $DIRNAME/second.txt $DIRNAME/third.json
    

    and further use brace expansion:

      touch $DIRNAME/{first.txt,second.txt,third.json}
    
  • I would consider here-documenting the json files instead of echoing them, along the lines of:

      cat <<< EOF >> $DIRNAME/test.json
      {
           "enabled": true
      }
      EOF
    
  • tail must to read the whole file. Calling sort with a -r (aka --reverse option) you can use head instead.

  • touch takes multiple arguments. You may

      touch $DIRNAME/first.txt $DIRNAME/second.txt $DIRNAME/third.json
    

    and further use brace expansion:

      touch $DIRNAME/{first.txt,second.txt,third.json}
    
  • I would consider here-documenting the json files instead of echoing them, along the lines of:

      cat < EOF >> $DIRNAME/test.json
      {
           "enabled": true
      }
      EOF
    
  • tail must to read the whole file. Calling sort with a -r (aka --reverse option) you can use head instead.

  • touch takes multiple arguments. You may

      touch $DIRNAME/first.txt $DIRNAME/second.txt $DIRNAME/third.json
    

    and further use brace expansion:

      touch $DIRNAME/{first.txt,second.txt,third.json}
    
  • I would consider here-documenting the json files instead of echoing them, along the lines of:

      cat << EOF >> $DIRNAME/test.json
      {
           "enabled": true
      }
      EOF
    
Source Link
vnp
  • 58.7k
  • 4
  • 55
  • 144

  • tail must to read the whole file. Calling sort with a -r (aka --reverse option) you can use head instead.

  • touch takes multiple arguments. You may

      touch $DIRNAME/first.txt $DIRNAME/second.txt $DIRNAME/third.json
    

    and further use brace expansion:

      touch $DIRNAME/{first.txt,second.txt,third.json}
    
  • I would consider here-documenting the json files instead of echoing them, along the lines of:

      cat < EOF >> $DIRNAME/test.json
      {
           "enabled": true
      }
      EOF