0

When I try to echo via my script to an existing file, the script doesn't recognize the existing file and creates a duplicate file on Android.

This is the input code in script:

>echo "Hello" > /system/etc/new

This is the output in terminal for:

>cat /system/etc/new

/system/etc/new: No such file or directory

SwiftArchitect
  • 47,376
  • 28
  • 140
  • 179
  • do an (ls /system/etc) -- do you see any files listed or do you get an error?? – Tasos Jan 23 '16 at 03:42
  • 2
    Are you running as the root user? Otherwise you cannot write to /system. You can have the top of the script basically call "su -c ....." before running – childofthehorn Jan 23 '16 at 03:49
  • ls in the directory does show the file,Yes I am running as root and mounted system read-write , just that the file created by script is not recognised by terminal – Senthil360 Jan 23 '16 at 07:33

1 Answers1

1

Are you not experiencing:

Permission denied

At any rate,

echo "Hello" > /system/etc/new

is not allowed to write into /system/etc/.

Likely answered on https://stackoverflow.com/a/550808/218152.

Community
  • 1
  • 1
SwiftArchitect
  • 47,376
  • 28
  • 140
  • 179
  • Nothing of that sort , System is mounted rw , but file will get duplicated and original one cannot be recognised – Senthil360 Jan 23 '16 at 07:35
  • Can you develop on *duplicated*? Does the old file get renamed somehow? If so, to what? What does `ls -al /system/etc/new*` return? – SwiftArchitect Jan 23 '16 at 17:13