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 9143065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:55:54+00:00 2026-06-17T09:55:54+00:00

I am getting the error: line 34: #10#1001: syntax error: operand expected (error token

  • 0

I am getting the error: line 34: #10#1001: syntax error: operand expected (error token is “#10#1001”)

I have just changed

[! -f INPUT ] & 

to

[ ! -f INPUT ] &&

and now i am getting the error

line 34: #10#1001: syntax error: operand expected (error token is "#10#1001")

when i run the script.

The script inputs users names, phones numbers and dob and then sorts the infomation and calculates their ages.

What could be causing this error as i cannot work out what operand it is demanding

#!/bin/bash

a=0
while [ $a -lt 2 ];
do
    echo Please enter a first name
    read firstName
    echo Please enter last name
    read lastName
    echo Please enter phone number
    read phoneNumber
    echo Please enter date of birth - format dd/mm/yyyy
    read dob
    echo "$firstName,$lastName,$phoneNumber,$dob" >> userBirthdays.csv
    echo If you would like to add another person press 1 or enter 2 to proceed
    read a
done

    INPUT=./userBirthdays.csv
    OLDIFS=$IFS
    IFS=","
    [ ! -f INPUT ] && while read  while read Name Surname Telephone DOB
    do
                    birthMonth=${DOB:0:2}
                    birthDay=#10${DOB:3:2}
                    birthYear=${DOB:6:4}

                    currentDate=`date +%d/%m/%Y`

                    currentMonth=${currenDate:0:2}
                    currentDay=#10${currentDate:3:2}
                    currentYear=${currentDate:6:4}

                    if [[ "$currentMonth" -lt "$birthMonth" ]] || [[ "$currentMonth" -eq "$birthMonth" && "$((#10$currentDay))" -lt "$((#10$birthDay))" ]]
                    then
                            let Age=currentYear-birthYear-1
                    else
                            let Age=currentYear-birthYear
                    fi

            echo "Name : $Name"
            echo "Surname : $Surname"
            echo "Telephone : $Telephone"
            echo "DOB : $DOB"
            echo "Age : $Age"
            echo "##########################################"
done < $INPUT
IFS=$OLDIFS
    echo $DATE

exit 0;
  • 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-06-17T09:55:55+00:00Added an answer on June 17, 2026 at 9:55 am

    You have two mistakes on this line:

    [ ! -f INPUT ] && while read  while read Name Surname Telephone DOB
    

    It should be:

    [ -f ${INPUT} ] && while read Name Surname Telephone DOB
    

    I recommend debugging your script with:

    bash -x /path/to/birthdays.bash 
    

    This will print command traces before executing each command.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting this error on line 6: error: expected unqualified-id before '{' token I
I am getting an error Incorrect syntax near ',' for this query on line
I keep getting an expected identifier error at this line in my code =/
I have made some progress and now i am getting this error the message
I think I am getting the error [Syntax Error] line 0, col 194: Error:
I have coded a nice script but i am constantly getting Error on line
Hi i am getting error on this line. Its working in local. I just
I am keep getting NullPointerException error at line JSONObject json = userFunctions.uploadFileData(guid, photoName); in
I am getting an error at the line void operation when I compile, because
I am getting ERROR when I am running this program at the line static

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.