4 edited tags
| link
3 edited tags
| link
2 added 4 characters in body
source | link

I am having a lot of trouble using a command line argument in a script file to check if a file is being entered in the command line. So basically I have a script file named ./file and a logfile named log. I have an if then else statement to run a check to see if the right file is entered and if not the program exits with an echo error. If the right file name is entered then it continues to run script. I either get an error directory or file doesn't exist or my echo error no matter what I do. Can someone please point out what I'm doing wrong? Thank you for any help provided. I am using putty. this is what I have

  if ["./file"]file log"]
      then
            echo ""
  else
            echo "error"
            exit 0
  fi

I am having a lot of trouble using a command line argument in a script file to check if a file is being entered in the command line. So basically I have a script file named ./file and a logfile named log. I have an if then else statement to run a check to see if the right file is entered and if not the program exits with an echo error. If the right file name is entered then it continues to run script. I either get an error directory or file doesn't exist or my echo error no matter what I do. Can someone please point out what I'm doing wrong? Thank you for any help provided. I am using putty. this is what I have

  if ["./file"]
      then
            echo ""
  else
            echo "error"
            exit 0
  fi

I am having a lot of trouble using a command line argument in a script file to check if a file is being entered in the command line. So basically I have a script file named ./file and a logfile named log. I have an if then else statement to run a check to see if the right file is entered and if not the program exits with an echo error. If the right file name is entered then it continues to run script. I either get an error directory or file doesn't exist or my echo error no matter what I do. Can someone please point out what I'm doing wrong? Thank you for any help provided. I am using putty. this is what I have

  if ["./file log"]
      then
            echo ""
  else
            echo "error"
            exit 0
  fi
1
source | link