Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7547023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:20:54+00:00 2026-05-30T09:20:54+00:00

what is wrong with my script? I am trying to call a function to

  • 0

what is wrong with my script? I am trying to call a function to see if a file is larger than a specified amount. If it is, i would like to remove the second file. If it is not larger than the specified amount than i would like the program to exit. Instead, I get this error message:
“syntax error near unexpected token `FILE'”
Can someone please help or direct me where I can get some help? Thanks. I have a Bash shell.

function e{
FILE = $1
FILESIZE=$(stat -c%s "$FILE") 
if [ "$FILESIZE" -gt 2048 ]; then
   echo "File $1 exists"
   `rm $2`
else
   echo "File $1 does not exist" 
   exit 
fi
}

e AD4_1hit.paired_mult.bam AD4_1hit.halfmapping_transloc.bam
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T09:20:55+00:00Added an answer on May 30, 2026 at 9:20 am

    You need to remove the spaces around the = …

    FILE=$1
    

    BTW, you don’t need the command-substitution `…` syntax around your rm command.

    e () {
      FILE=$1
      FILESIZE=$(stat -c%s "$FILE")
      if [ "$FILESIZE" -gt 2048 ]; then
         echo "File $1 exists"
         rm $2
      else
         echo "File $1 does not exist"
         exit
      fi
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to call to external PHP script using Ajax like this: $(function() {
Can anyone see anything wrong with this login script: public function login($username, $pass, $remember)
I'm trying to use jQuery's get function to call my php script. The php
In the following I am trying call action script function from js function. What
I am trying to call a function in another .php file from this one
I am trying to call call action script function from JS but i get
I am trying to call a jquery function on clicking a button in the
I am trying to make an ajax call to a php script. The php
I have a javascript function from where I am trying to call the serverside
I am trying to load the statcounter script from my custom js file. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.