Skip to content

Instantly share code, notes, and snippets.

@georgekovachjr
Forked from zoka123/test.sh
Created April 26, 2023 23:17
Show Gist options
  • Select an option

  • Save georgekovachjr/54769f1fe05a8599cdadb6cdb174570d to your computer and use it in GitHub Desktop.

Select an option

Save georgekovachjr/54769f1fe05a8599cdadb6cdb174570d to your computer and use it in GitHub Desktop.

Revisions

  1. @zoka123 zoka123 created this gist Aug 4, 2016.
    5 changes: 5 additions & 0 deletions test.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    # By path
    if [ -w "/path/to/dir" ]; then echo "WRITABLE"; else echo "NOT WRITABLE"; fi

    # Current dir
    if [ -w `pwd` ]; then echo "WRITABLE"; else echo "NOT WRITABLE"; fi