holy_sin
V2EX  ›  问与答

怎么把 xcode 下面的单倍图片全部删除?

  •  
  •   holy_sin · Jun 27, 2014 · 3034 views
    This topic created in 4358 days ago, the information mentioned may be changed or developed.
    工程较大,有很多存储图片的目录,我想把所有的单倍图片(不带@2x)的图片全部删除,有什么好办法吗?

    #!/bin/bash

    dir="/Users/liuyue/Workspace/Repo/kbatterydoctor_trunk"
    cd $dir
    all_pngs=`find . -name "*.png" | sort -u`
    for png in $all_pngs
    do
    # echo "$png"
    #get the dirname
    dirname=`dirname $png`
    #get the filename without dir
    filename=`basename $png`
    #get name without suffix
    name=`echo "$filename" | cut -d '.' -f1`

    done

    问题是不知道怎么找出不带@2x的文件名。
    1 replies    2014-06-27 13:03:38 +08:00
    run2
        1
    run2  
       Jun 27, 2014
    直接用finder搜不可以么
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2773 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 15:49 · PVG 23:49 · LAX 08:49 · JFK 11:49
    ♥ Do have faith in what you're doing.