Any way to interpret string representing an integer or operation? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election Results Why I closed the “Why is Kali so hard” questionconverting numbers into full writen wordsFind files that have words in commonAchieving hexdump-like format, that includes binary strings, on the command line?Linux cgroups: limit CPU usage in absolute values which do not depend on CPU speedFind a “moderately large” divisor of a given number?Does 'multiport' make a difference in terms of efficiency?Run local script with local input file on remote hostsed? - Insert line after a string with special characters to Neutron serviceToo many shebang (script declaration) lines — any way to reduce their amount?Can we write a script to run some command within each interactive bash shell process?String to integer in Shell

Proof involving the spectral radius and Jordan Canonical form

Why one of virtual NICs called bond0?

What makes black pepper strong or mild?

Why are there no cargo aircraft with "flying wing" design?

How can I make names more distinctive without making them longer?

Why is "Captain Marvel" translated as male in Portugal?

Models of set theory where not every set can be linearly ordered

Is the Standard Deduction better than Itemized when both are the same amount?

Is there a "higher Segal conjecture"?

How can I fade player when goes inside or outside of the area?

Why does Python start at index -1 when indexing a list from the end?

What is the musical term for a note that continously plays through a melody?

Output the ŋarâþ crîþ alphabet song without using (m)any letters

Are my PIs rude or am I just being too sensitive?

What is this single-engine low-wing propeller plane?

Gastric acid as a weapon

Doubts about chords

"Seemed to had" is it correct?

Can inflation occur in a positive-sum game currency system such as the Stack Exchange reputation system?

G-Code for resetting to 100% speed

Check which numbers satisfy the condition [A*B*C = A! + B! + C!]

Do I really need recursive chmod to restrict access to a folder?

Letter Boxed validator

What's the purpose of writing one's academic bio in 3rd person?



Any way to interpret string representing an integer or operation?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionconverting numbers into full writen wordsFind files that have words in commonAchieving hexdump-like format, that includes binary strings, on the command line?Linux cgroups: limit CPU usage in absolute values which do not depend on CPU speedFind a “moderately large” divisor of a given number?Does 'multiport' make a difference in terms of efficiency?Run local script with local input file on remote hostsed? - Insert line after a string with special characters to Neutron serviceToo many shebang (script declaration) lines — any way to reduce their amount?Can we write a script to run some command within each interactive bash shell process?String to integer in Shell



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















Lets say I have this string



one plus two


Is there any way we can interpret this as 1 + 2 faster than going into some conditions checking word per word and testing it if it equal something in a given list? Like



if [ `(word)` = "one" ]
elif [ `(word)` = "two" ]


etc..










share|improve this question
























  • A broad challenge; unix.stackexchange.com/a/413475/117549 may help.

    – Jeff Schaller
    Apr 11 at 19:45











  • Also: metacpan.org/pod/Lingua::EN::Words2Nums , if Perl is an option.

    – Jeff Schaller
    Apr 11 at 19:55


















0















Lets say I have this string



one plus two


Is there any way we can interpret this as 1 + 2 faster than going into some conditions checking word per word and testing it if it equal something in a given list? Like



if [ `(word)` = "one" ]
elif [ `(word)` = "two" ]


etc..










share|improve this question
























  • A broad challenge; unix.stackexchange.com/a/413475/117549 may help.

    – Jeff Schaller
    Apr 11 at 19:45











  • Also: metacpan.org/pod/Lingua::EN::Words2Nums , if Perl is an option.

    – Jeff Schaller
    Apr 11 at 19:55














0












0








0








Lets say I have this string



one plus two


Is there any way we can interpret this as 1 + 2 faster than going into some conditions checking word per word and testing it if it equal something in a given list? Like



if [ `(word)` = "one" ]
elif [ `(word)` = "two" ]


etc..










share|improve this question
















Lets say I have this string



one plus two


Is there any way we can interpret this as 1 + 2 faster than going into some conditions checking word per word and testing it if it equal something in a given list? Like



if [ `(word)` = "one" ]
elif [ `(word)` = "two" ]


etc..







linux shell-script arithmetic






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 11 at 19:50









Jeff Schaller

45k1164147




45k1164147










asked Apr 11 at 19:26









William ChrétienWilliam Chrétien

53




53












  • A broad challenge; unix.stackexchange.com/a/413475/117549 may help.

    – Jeff Schaller
    Apr 11 at 19:45











  • Also: metacpan.org/pod/Lingua::EN::Words2Nums , if Perl is an option.

    – Jeff Schaller
    Apr 11 at 19:55


















  • A broad challenge; unix.stackexchange.com/a/413475/117549 may help.

    – Jeff Schaller
    Apr 11 at 19:45











  • Also: metacpan.org/pod/Lingua::EN::Words2Nums , if Perl is an option.

    – Jeff Schaller
    Apr 11 at 19:55

















A broad challenge; unix.stackexchange.com/a/413475/117549 may help.

– Jeff Schaller
Apr 11 at 19:45





A broad challenge; unix.stackexchange.com/a/413475/117549 may help.

– Jeff Schaller
Apr 11 at 19:45













Also: metacpan.org/pod/Lingua::EN::Words2Nums , if Perl is an option.

– Jeff Schaller
Apr 11 at 19:55






Also: metacpan.org/pod/Lingua::EN::Words2Nums , if Perl is an option.

– Jeff Schaller
Apr 11 at 19:55











0






active

oldest

votes












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511977%2fany-way-to-interpret-string-representing-an-integer-or-operation%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511977%2fany-way-to-interpret-string-representing-an-integer-or-operation%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

NetworkManager fails with “Could not find source connection”Trouble connecting to VPN using network-manager, while command line worksHow can I be notified about state changes to a VPN adapterBacktrack 5 R3 - Refuses to connect to VPNFeed all traffic through OpenVPN for a specific network namespace onlyRun daemon on startup in Debian once openvpn connection establishedpfsense tcp connection between openvpn and lan is brokenInternet connection problem with web browsers onlyWhy does NetworkManager explicitly support tun/tap devices?Browser issues with VPNTwo IP addresses assigned to the same network card - OpenVPN issues?Cannot connect to WiFi with nmcli, although secrets are provided