Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
Bash script problem
Results 1 to 2 of 2

Thread: Bash script problem

Hybrid View

  1. #1
    Moderator
    Good Guru
    Schotty's Avatar
    Join Date
    Jul 2001
    Location
    Milwaukee, WI
    Posts
    5,760

    Bash script problem

    I am looking at automating unzipping some files I have in directories. I am having a problem getting thru dumb characters in the filename, like spaces and dashes.

    for i in ls *7z; do 7za -y e $i; done

    This fails at those special cases. What do I do to properly pass in the proper filename?

    Thanks!
    Andrew.

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


  2. #2
    Moderator
    Good Guru
    Schotty's Avatar
    Join Date
    Jul 2001
    Location
    Milwaukee, WI
    Posts
    5,760
    while read `ls *` ; do 7za -y e $i; done
    find . -name '*.jpg' | while read i; do ls -l "$i";
    find . -name '*.jpg' -print0 | xargs -0 -l1 ls -l
    for i in *; do 7za -y e "${i}"; done


    Those are all solutions that I got in IRC. Figured I would pass them on. Of course a few were generic (like the middle two). Those are functionally identical.

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Similar Threads

  1. Help with bash script
    By woodson2 in forum Linux - Software, Applications & Programming
    Replies: 5
    Last Post: 12-30-2010, 07:19 PM
  2. SSH and bash script
    By vwgtiturbo in forum Programming
    Replies: 7
    Last Post: 12-25-2008, 05:40 AM
  3. Problem whit Script BASH!!!
    By Pitoniso in forum Windows - General Topics
    Replies: 2
    Last Post: 04-04-2007, 12:13 PM
  4. Bash script
    By linuxuser in forum Programming
    Replies: 1
    Last Post: 09-01-2005, 03:21 PM
  5. Help with bash script
    By tolstoy in forum Programming
    Replies: 5
    Last Post: 05-21-2002, 11:17 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •