Skip to content

Commit

Permalink
Upd
Browse files Browse the repository at this point in the history
  • Loading branch information
EvelinaVinnikova committed Oct 4, 2024
1 parent f49dcd2 commit cccdd8e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions solution/untar
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/bash

if [ "$#" -ne 1 ]; then
exit 1
fi

archive="$1"

if [ ! -f "$archive" ]; then
exit 1
fi

unpacked_dir="${archive}.unpacked"

if [ ! -d "$unpacked_dir" ]; then
mkdir "$unpacked_dir"
fi
tar -xf "$archive" -C "$unpacked_dir"

0 comments on commit cccdd8e

Please sign in to comment.