Timeline for Why doesn't the conditional work when I use it directly without a variable?
Current License: CC BY-SA 4.0
        21 events
    
    | when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 6, 2019 at 13:07 | history | edited | Rui F Ribeiro | CC BY-SA 4.0 | 
                
                    deleted 102 characters in body 
                
             | 
| Jan 15, 2017 at 21:55 | comment | added | Gilles 'SO- stop being evil' | Background reading: Why does my shell script choke on whitespace or other special characters?, What is the difference between [[ $a == z* ]]and[ $a == z* ]? | |
| Jan 15, 2017 at 14:28 | comment | added | muru | @richard OP said in a comment that was a typo and that the extra ] is not in the actual code | |
| Jan 15, 2017 at 14:27 | comment | added | ctrl-alt-delor | @muru you just changed the question (to fix the code), but now it saw this perfectly good code gives an error (that it does not). | |
| Jan 15, 2017 at 14:20 | history | edited | muru | CC BY-SA 3.0 | 
                
                    deleted 2 characters in body 
                
             | 
| Jan 15, 2017 at 9:12 | comment | added | Patrick Trentin | look for a tool called shellcheck to test your own scripts, it's s great learning tool for basic mistakes like this | |
| Jan 15, 2017 at 7:24 | history | tweeted | twitter.com/StackUnix/status/820532013962850307 | ||
| Jan 15, 2017 at 5:14 | answer | added | icarus | timeline score: 4 | |
| S Jan 15, 2017 at 5:10 | history | suggested | Spikatrix | CC BY-SA 3.0 | 
                
                    OP's edit made the first point of the accepted answer invalid. Also, improved title 
                
             | 
| Jan 15, 2017 at 4:40 | review | Suggested edits | |||
| S Jan 15, 2017 at 5:10 | |||||
| Jan 15, 2017 at 4:40 | history | edited | Jeff Schaller♦ | 
                
                    edited tags 
                
             | |
| Jan 15, 2017 at 3:37 | comment | added | Script Kitty | @JuliePelletier $i is in a for i in ...loop and echoes alright in scope. You're right that $i has been the problem. Thanks for helping yall | |
| Jan 15, 2017 at 3:32 | vote | accept | Script Kitty | ||
| Jan 15, 2017 at 3:28 | comment | added | Julie Pelletier | On top of the two good answers you got, I'd also like to add that the only case that I was able to reproduce your error is when the file referred by $idoesn't exist, which denotes another thing you should check. | |
| Jan 15, 2017 at 3:26 | answer | added | Sergiy Kolodyazhnyy | timeline score: 4 | |
| Jan 15, 2017 at 3:26 | answer | added | heemayl | timeline score: 7 | |
| Jan 15, 2017 at 3:23 | history | edited | Script Kitty | CC BY-SA 3.0 | 
                
                    removed extra ] 
                
             | 
| Jan 15, 2017 at 3:22 | comment | added | Script Kitty | @JuliePelletier Oops sorry that was a typo from the stackoverflow side. I will edit my question. I confirmed there is not an extra ] in my code and it still gives "too many arguments" on that line | |
| Jan 15, 2017 at 3:21 | review | First posts | |||
| Jan 15, 2017 at 4:18 | |||||
| Jan 15, 2017 at 3:18 | comment | added | Julie Pelletier | Right from the start your square brackets are not balanced in the first case.  (one too many ]) | |
| Jan 15, 2017 at 3:17 | history | asked | Script Kitty | CC BY-SA 3.0 |