Timeline for using tilde in variable from the user
Current License: CC BY-SA 3.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 14, 2017 at 15:18 | vote | accept | erans | ||
| Nov 14, 2017 at 2:51 | answer | added | Wildcard | timeline score: 1 | |
| Nov 14, 2017 at 2:44 | comment | added | Wildcard | Also see Why does my shell script choke on whitespace or other special characters? and Security implications of forgetting to quote a variable in bash/POSIX shells. | |
| Nov 14, 2017 at 0:24 | answer | added | m0dular | timeline score: 1 | |
| Nov 13, 2017 at 19:57 | comment | added | Valentin Bajrami | @erans no, please edit your question, and show exactly what's not working. | |
| Nov 13, 2017 at 19:52 | comment | added | erans | @val0x00ff read -p "Enter new path or type 'exit': " ans + read -p 'Enter new path or type '\''exit'\'': ' ans. I got this thing. unfortunately your suggestion didn't work :( | |
| Nov 13, 2017 at 19:52 | comment | added | erans | @TimothyMartin yes because if i type other paths or just /home/.. instead of ~ it's working. | |
| Nov 13, 2017 at 19:50 | answer | added | John | timeline score: 1 | |
| Nov 13, 2017 at 19:36 | comment | added | Valentin Bajrami |
Try file=$(grep -x "$ans" ~/.Log); echo "$file". Also running your little script using bash -xv yourscript what output do you get?
|
|
| Nov 13, 2017 at 19:36 | comment | added | Timothy Martin |
Are you certain the problem is the tilde and not the -x option to grep?
|
|
| Nov 13, 2017 at 19:15 | history | asked | erans | CC BY-SA 3.0 |