Script failing with tar command.
Building myself some install scripts. This is giving me issues.
Code:
theming() Code:
tar: ilinux.tar.gz: Cannot open: No such file or directory Code:
theming ~/Debian/icons ~/icons |
It's not a simple tar file, but a tar then zipped file (see file extension i.e. tar.gz), so in addition to tar extraction options, use -z switch as well.
For instance, to extract a tar.gz file, use command: Code:
# tar -zxvf ilinux.tar.gz |
This is with z switch.
Code:
tar (child): ilinux.tar.gz: Cannot open: No such file or directory Code:
tar -xf ??.tar.gz -C /path/ *EDIT* I should redo the subject as files exist but don't exist? |
http://mywiki.wooledge.org/BashGuide
For tips Your problem is the ls $1 , you get a list of files, but not full path You could do tar -xf ${1}/${i} ..... But using ls for this kind of thing is bad see link above This should work for you Code:
for tarball in ${1}/*.tar.gz;do |
Went ahead and altered my for statements using direct instead of ls. Won't be as recyclable as I liked but it is at least it will work out of the box on any debian based distros.
Thank you for looking and figuring it out. |
All times are GMT -5. The time now is 03:42 AM. |