Tagged Questions
2
votes
3answers
78 views
Very strange behavior with grep and IFS
I'm having trouble using grep, the returned results are "n-empty", I mean without the 'n' character...
This is the script sample :
OLDIFS=$IFS
IFS="\\n"
i=$(grep -ril $1 *)
echo $i
IFS=$OLDIFS
...
6
votes
1answer
121 views
Wildcards inside quotes
This will be an easy one, but in my memories, when shell scripting, using double quotes would allow expanding globbing and variables.
But in the following code:
#!/bin/sh
echo *.sh
echo "*.sh"
echo ...
1
vote
1answer
75 views
How to prevent double escaping?
I'm trying to put a bunch of images together into a pdf. I ran gm convert *.jpg out.pdf and it worked, but the images were not in the right order.
I found that ls -v orders them correctly so then I ...
17
votes
1answer
648 views
Why doesn't 'find' show this file?
Using find with grep, one can locate files that match a pattern:
# find | grep error
./solr-modifiedSolr4/SolrPhpClient/phpdocs/errors.html
./error_log
./includes/classes/error_log
However, using ...
1
vote
3answers
465 views
How can we rename a file with semi-colon as part of the filename?
I tried to rename all file with extension "XLS;1" to "XLS" but it just didn't work.
I tried the following in cygwin in windows xp and they don't work:
mv *.XLS;1 *.XLS
mv *.XLS\;1 *.XLS
mv ...