2 deleted 114 characters in body; deleted 11 characters in body
source | link

Pardon me, but I don't actually know where to begin with this - I will update if I get further. Sorry. Basically, I've got a list in a text file similar in structure to the following:

symlink("toolbox", "/system/bin/schedtop");
symlink("toolbox", "/system/bin/sendevent");
symlink("toolbox", "/system/bin/setconsole");
symlink("toolbox", "/system/bin/setenforce");
symlink("toolbox", "/system/bin/setprop");
symlink("toolbox", "/system/bin/setsebool");
symlink("mksh", "/system/bin/sh");

What I want to do is change them, using a Bash script, to be like the following:

symlink("toolbox", "/system/bin/schedtop", "/system/bin/sendevent", "/system/bin/setconsole", "/system/bin/setenforce", "/system/bin/setprop", "/system/bin/setsebool")
symlink("mksh", "/system/bin/sh");

This means grouping the lines and merging them based on the original file, in this case, toolbox.

Currently I'm just sorting the file by name, but that's not satisfactory, of course! Can anyone point me in the right direction?

Thanks!

Pardon me, but I don't actually know where to begin with this - I will update if I get further. Sorry. Basically, I've got a list in a text file similar in structure to the following:

symlink("toolbox", "/system/bin/schedtop");
symlink("toolbox", "/system/bin/sendevent");
symlink("toolbox", "/system/bin/setconsole");
symlink("toolbox", "/system/bin/setenforce");
symlink("toolbox", "/system/bin/setprop");
symlink("toolbox", "/system/bin/setsebool");
symlink("mksh", "/system/bin/sh");

What I want to do is change them, using a Bash script, to be like the following:

symlink("toolbox", "/system/bin/schedtop", "/system/bin/sendevent", "/system/bin/setconsole", "/system/bin/setenforce", "/system/bin/setprop", "/system/bin/setsebool")
symlink("mksh", "/system/bin/sh");

This means grouping the lines and merging them based on the original file, in this case, toolbox.

Currently I'm just sorting the file by name, but that's not satisfactory, of course! Can anyone point me in the right direction?

Thanks!

I've got a list in a text file similar in structure to the following:

symlink("toolbox", "/system/bin/schedtop");
symlink("toolbox", "/system/bin/sendevent");
symlink("toolbox", "/system/bin/setconsole");
symlink("toolbox", "/system/bin/setenforce");
symlink("toolbox", "/system/bin/setprop");
symlink("toolbox", "/system/bin/setsebool");
symlink("mksh", "/system/bin/sh");

What I want to do is change them, using a Bash script, to be like the following:

symlink("toolbox", "/system/bin/schedtop", "/system/bin/sendevent", "/system/bin/setconsole", "/system/bin/setenforce", "/system/bin/setprop", "/system/bin/setsebool")
symlink("mksh", "/system/bin/sh");

This means grouping the lines and merging them based on the original file, in this case, toolbox.

Currently I'm just sorting the file by name, but that's not satisfactory, of course! Can anyone point me in the right direction?

    Tweeted twitter.com/#!/StackUnix/status/630624425696694273
1
source | link

Recursively grouping symlinks by original file

Pardon me, but I don't actually know where to begin with this - I will update if I get further. Sorry. Basically, I've got a list in a text file similar in structure to the following:

symlink("toolbox", "/system/bin/schedtop");
symlink("toolbox", "/system/bin/sendevent");
symlink("toolbox", "/system/bin/setconsole");
symlink("toolbox", "/system/bin/setenforce");
symlink("toolbox", "/system/bin/setprop");
symlink("toolbox", "/system/bin/setsebool");
symlink("mksh", "/system/bin/sh");

What I want to do is change them, using a Bash script, to be like the following:

symlink("toolbox", "/system/bin/schedtop", "/system/bin/sendevent", "/system/bin/setconsole", "/system/bin/setenforce", "/system/bin/setprop", "/system/bin/setsebool")
symlink("mksh", "/system/bin/sh");

This means grouping the lines and merging them based on the original file, in this case, toolbox.

Currently I'm just sorting the file by name, but that's not satisfactory, of course! Can anyone point me in the right direction?

Thanks!