Permalink
Browse files

Use /dev/shm if available to do line by line processing

  • Loading branch information...
1 parent c9dcf4c commit b349377cf08ef795ad2a3829018b184e09a9eb1f @dalingrin committed Jan 30, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 pbfetch
View
@@ -356,8 +356,13 @@ checkVersion () {
for x in ${pkgName[@]}; do
curlArgs="$curlArgs$(echo "${url}$x ")"
done
-
- tempFile=$(mktemp --suffix=-pbfetch)
+
+ if [ -d "/dev/shm" ]; then
+ tempFile=$(mktemp -p /dev/shm --suffix=-pbfetch)
+ else
+ tempFile=$(mktemp --suffix=-pbfetch)
+ fi
+
curl -s ${curlArgs}| sed 's/{"type"/\n/g' | sed '/^$/d' >> $tempFile
echo "" >> $tempFile

0 comments on commit b349377

Please sign in to comment.