#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    391
    Rep Power
    22

    If statement in command


    I'm trying to list out all the files in the current directory, but the following just lists out the all the files

    Code:
    for i in *;
    do
    if [[ "$i"!="fileOne" && "$i"!="otherFile" ]]; then
    echo $i;
    fi;
    done
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    391
    Rep Power
    22
    Got the if statement

    Code:
    for i in *;
    do
    if [ "$i"!='fileOne' -a "$i"!='otherFile' ]; then
    echo $i;
    fi;
    done

IMN logo majestic logo threadwatch logo seochat tools logo