2

I found that it happens because it splits entered arguments. But I am creating a program that encrypts string and it encrypted "test" as |m{|. But when I switch to decryption mode that thing happens. Any solution ?

marked as duplicate by glenn jackman, Thomas, Eric Carvalho, Sergiy Kolodyazhnyy command-line Jan 16 at 21:08

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

5

The > comes from bash's $PS2 variable. man bash says:

PS2    The value of this parameter is expanded as with PS1 and used as the secondary prompt string.  The default is ``> ''.

I often see > when I have an unmatched quote (") or apostrophe ('), or some other input that bash views as incomplete.

  • Is there any way to input "|m{|" (without quotes) into terminal ? – Stel Team Jan 16 at 16:10
  • 1
    @StelTeam I believe terminal is waiting for you to enter }. What's wrong if it is enter within double quotes? I think it is just a filename. Isn't it? – Kulfy Jan 16 at 16:44
  • @Kulfy The string |m{| is the encrypted version of "test". so the program must take |m{| as an argument in order to decrypt it as "test" – Stel Team Jan 16 at 16:46
  • 3
    ... if you enter "|m{|" '|m{|' in the shell as an argument to your program, your program will not see the quotes (they will simply prevent the shell from trying to interpret the sequence) – steeldriver Jan 16 at 16:51
  • @StelTeam Without quotes | will be treated as pipe symbol and { as start of compound command, therefore the shell will treat it as part of its syntax and consider the line you entered incomplete. That's what > signifies. – Sergiy Kolodyazhnyy Jan 16 at 21:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.