101 reputation
19
bio website
location
age
visits member for 3 years, 4 months
seen Jul 20 at 1:00

Sep
4
awarded  Popular Question
Apr
18
awarded  Enthusiast
Apr
5
comment How to remove trailing whitespace from file extensions and folders snow?
sorry I'm not sure how I missed this but each time I run this script it returns: invalid argument do you know why that could be ?
Apr
4
comment How to remove trailing whitespace from file extensions and folders snow?
whoops turns out I had DOS line breaks in there, had to convert to UNIX. So this works very nicely. Thank you.
Apr
4
comment How to remove leading whitespace from file and folder names?
Thank you both for helping find the solution.
Apr
4
accepted How to remove leading whitespace from file and folder names?
Apr
4
comment How to remove trailing whitespace from file extensions and folders snow?
sorry for late turnaround, i tried your new script but got this error, line 4: syntax error near unexpected token `done'
Mar
27
comment How to remove trailing whitespace from file extensions and folders snow?
now that you have edited the script, do you not need to specify the string to look for ? eg '* ' or ' *'
Mar
26
asked How to remove leading whitespace from file and folder names?
Mar
23
accepted How to remove trailing whitespace from file extensions and folders snow?
Mar
22
comment How to remove trailing whitespace from file extensions and folders snow?
Oh yes, I forgot to change the attribute. OK so now your initial example works removing the trailing whitespace. Now I'm trying to remove the leading whitespace replacing the line mv "$f" "$(sed 's/ *$//' <<< "$f")" with mv "$f" "$(sed 's/^ *//;s/ *$//' <<< "$f")" so perhaps I've misunderstood ?
Mar
22
comment How to remove trailing whitespace from file extensions and folders snow?
Yes I'm running the script as sudo ./script.sh I also tried this on the cl IFS=$'\n'; for d in {1..9}; do find ~/test -name '* ' -depth $d | while read f; do mv "$f" "$(sed 's/ *$//' <<< "$f")" done done there was no error, but it just hung and did not return to the prompt.
Mar
22
comment How to remove trailing whitespace from file extensions and folders snow?
If I enter the original on one line in Terminal I get: syntax error near unexpected token `do' and if run in a script i get command not found.
Mar
21
comment How to remove trailing whitespace from file extensions and folders snow?
Thank you for the feedback. Now that you mention it I would certainly like to remove the leading whitespace too. I'm a bit confused how the script would look in that case. Do mean remove $'\n' and | while read to achieve this ?
Mar
20
asked How to remove trailing whitespace from file extensions and folders snow?
Nov
8
accepted Multiple Instances Of Applications in Parental Controls - Allowed Apps List After Snow Upgrade
Oct
28
answered Multiple Instances Of Applications in Parental Controls - Allowed Apps List After Snow Upgrade
Oct
28
revised Multiple Instances Of Applications in Parental Controls - Allowed Apps List After Snow Upgrade
edited title
Oct
20
comment OSX Can ping and GUI login but Unable to SSH login via LAN
Thank you David.
Oct
20
accepted OSX Can ping and GUI login but Unable to SSH login via LAN