Author Topic: This script not works.  (Read 70 times)

iOtero

  • Sr. Member
  • ****
  • Posts: 266
    • View Profile
This script not works.
« on: February 11, 2019, 01:11:30 PM »
This script works perfectly in raspbian and in ubuntu, but not in lakka:

Code: [Select]
#!/bin/bash

IFS=';'

cd /storage/.attract/romlists
rm Favorites.txt

touch Favorites.txt
chmod 777 Favorites.txt

ls *.tag > tagfiles
while read filename
do
  while read gamename
  do
    romlist=`echo ${filename} |cut -f1 -d '.'`
    cat "${romlist}.txt"|grep "^${gamename};" >> Favorites.txt
  done < "${filename}"
done < tagfiles

rm tagfiles
cat Favorites.txt |sort -u > tmp_favorites.txt
mv tmp_favorites.txt Favorites.txt

sleep 5

The reading of the data is correct, but the redirection >> does not do anything.

In putty ssh this comand runs:

Code: [Select]
cat "Atari2600.txt" |grep "Centipede (USA)" >> Favorites.txt
but the script does not.

Does anyone know why?
I love that on my laptop the eyes shine to the Alien every time i access the ssd... :D