Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read line issue #1

Open
adamasantares opened this issue Dec 26, 2020 · 0 comments
Open

Read line issue #1

adamasantares opened this issue Dec 26, 2020 · 0 comments

Comments

@adamasantares
Copy link
Owner

Compilation problem. Reading data from stdin is recognized as simple string value

The code:

println("text1")
println("text1")

print("Continue? [y/n]:")
answer = @(read line; echo $line)
if (answer == "n") {
    println("Canceled")
}

Will be converted to:

function bish_main () {
    stdlib_println "${_0}";
    stdlib_println "${_1}";
    stdlib_print "${_2}";
    if [[ "${answer}" == "n" ]]; then
        local _3="Canceled";
        stdlib_println "${_3}";
    fi;
}
function stdlib_println () {
    local s="${1}";
    printf "%b" "${s}"; echo "";
}
args=( "$0" "$@" );
{
    _0=" - Apache2";
    _1="";
    _2="Continue? [y/n]:";
    answer=$(read line; echo ${line});
}
bish_main;

So answer=$(read line; echo ${line}); in the list of simple string arguments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant