Bash: Problem with Escaping the Space Character
In a bash script, I have the command:
Code:
ls -l --time-style=+'%y/%m/%d %H:%M:%S' Code:
options="-l --time-style=+'%y/%m/%d %H:%M:%S'" |
Try this:
Code:
options=(-l --time-style=+'%y/%m/%d %H:%M:%S') http://unix.stackexchange.com/questi...ial-characters Hopefully, someone else will elucidate... |
Works like a charm! Thanks!
|
I was intrigued too. The only way I could find is to use eval:
Code:
options="-l --time-style=+'%y/%m/%d %H:%M:%S'" Edit: The quotes around ls are optional. |
Quote:
Can you mark this thread as "Solved" please? Cheers. |
Another way is to alias ls, like
Code:
alias lstime='ls -l --time-style=+"%y/%m/%d %H:%M:%S"' |
All times are GMT -5. The time now is 07:25 PM. |