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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:55:00+00:00 2026-06-18T04:55:00+00:00

function get_arguments() { read -p ‘data : ‘ data read -p ‘lambda: ‘ lambda

  • 0
function get_arguments()
{
    read -p 'data : ' data
    read -p 'lambda: ' lambda
    echo $data $lambda 

}


 data,lambda=$(get_arguments)

But i am getting an error

data :  /home/wolfman/Downloads/data
lambda value: 2
./shell_script.sh: line 25: data,lambda,= /home/wolfman/Downloads/data: No such file or directory

But

1) Why is it even evaluating that whether that file exists or not.. its just a string??

2) what am i doing wrong 🙁

THanks

  • 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-18T04:55:01+00:00Added an answer on June 18, 2026 at 4:55 am

    sh syntax does not allow that. But, the variables in the function are global, so you can just invoke the function and data and lambda will be set in the caller.

    functions return an integer value, but they can print arbitrary data which can be read by the caller. For example, you could do:

    get_arguments | { read data lambda; echo $data $lambda; }
    

    The drawback is that the values are only available in that block. (The pipe creates a subshell, and the values read by read are only valid in that subshell.)

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

Sidebar

Related Questions

I get the error Warning: printf() [function.printf]: Too few arguments Looking at the code
function get_arr($arr) { unset($arr[0]); } $arr1 = array(1,2); $arr2 = array(1,2); get_arr(&$arr1); get_arr($arr2); echo
I get error: ORA-06575: Package or function GET_CONC_NAMES is in an invalid state When
I've a php function to get some data from mysql database: function get_persons() {
I read from the jQuery website, that get() loads data from the server using
i get this error, and i don't know how can be solved. I read
I am trying to read binary data from sys.stdin using Python 2.7 on Windows
I've read WordPress codex many times but still don't understand how to return the
I'm trying to make a jQuery mobile app read data from a server I'm
Possible Duplicate: Some issues trying to read a file with cbc.read.table function in R

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.