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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:30:40+00:00 2026-06-13T10:30:40+00:00

I want to prompt a user via command line & ask what specific rows

  • 0

I want to prompt a user via command line & ask what specific rows need to be cut from a data file using either head or tail. My script will employ head and tail using the inputs as variables for both head and tail commands. This is what I have thus far along with the error message:

echo -n "What rows need to be cut from your data file: "
read before
read after
head -n $before /home/rent_list
tail -n $after /home/rent_list 

Error message:

-bash: ./rent_list: bin/bash: bad interpreter: No such file or directory

Update: This is what I am getting now:

 What rows need to be cut from your data file: 4

Mack Tools  Milwaukee Wisconsin mj414@yahoo.com 414 2248893
Terry Tools Orlando Florida 407@yahoo.com 407 2439812
Park Tools  Riviera Beach Florida tp123@hotmail.com 516 5370923
Bike Tools  Orlando Florida baptiste41@gmail.com 407 3420983
tail: /home/renter_list: invalid number of lines
  • 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-13T10:30:42+00:00Added an answer on June 13, 2026 at 10:30 am

    The error-message seems to be saying that your script starts with #!bin/bash instead of #!/bin/bash (that is, that you’re missing a / before bin/bash).


    Update: Your new error-message is because you’re not entering a number. You have an echo, followed by two reads. For the first read, you’re entering 4, but for the second, you’re just hitting Enter. So the tail command is tail -n /home/rent_list.

    If you want to use the same number for both commands, you can write:

    echo -n "What rows need to be cut from your data file: "
    read num_rows
    head -n $num_rows /home/rent_list
    tail -n $num_rows /home/rent_list
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to prompt a user to cut from a 'last' command along with
I want to start a command prompt but don't want any output from it.
I want to compile C code from the Command Prompt in Windows. I have
I want to prompt a user to save a file when some modification has
I've got a form with a date and I want prompt the user if
I want to prompt the user that something special has happened, so I want
I prompt the user if they want to order fish, once they are done
Before the user closes the form I want to prompt with a confirmation box.
i want to call the command prompt command using Process.Start and then using StandardOutput
I want to FTP some files across networks using Windows FTP command prompt and

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.