I have a question for you, I'm trying to create a script that will automate creating loading screens for the iPhone.
So what I need to do, is list the directories inside /var/mobile/Applications and scan inside those, for the .app directory inside each. Take that .app name and create a folder in /var/stash/Themes/LoadingScreens.theme/Folders with the same name found earlier.
I tried to get the list with this command:
But what I get is a list with the full path in front of what I need to get. How could I either truncate it to keep only what I need, or either list only the .app directories, and not the full path preceding it?
I was able to shorten the path to: /ThisIsAnApp.app using the following command:
After looking at another post about truncating here.
While I can follow guides, and stuff, and I'm confortable with linux based system, I don't know the commands in enough details to come up with a solution myself. So just by telling me to look at the split function of perl, wouldnt be enough, but sure a starting point for me to look for.
Here is a concrete example of what exactly I'm trying to do.
If I list my /var/mobile/Applications, I will have a bunch of directories named like this:
026E729E-B9D1-4A7A-B07F-A5DAEA4F2E7E and so on.
Inside each is a few folders, and filenames. But what I want to get is the DoodleJump.app directory name inside that 026E729E-B9D1-4A7A-B07F-A5DAEA4F2E7E folder. Then create a DoodleJump.app folder in /var/stash/Themes/LoadingScreens.theme/Folders directory.
And repeat for every directories inside /var/mobile/Applications.
I hope it's more clear now.. Sorry I'm french, so...
---------- Post updated at 07:01 PM ---------- Previous update was at 06:59 PM ----------
Quote:
Originally Posted by agama
You could pipe the output through sed to strip the path:
I get this error message with the following line of code:
Currently I am using this laborious command
lvdisplay | awk '/LV Path/ {p=$3} /LV Name/ {n=$3} /VG Name/ {v=$3} /Block device/ {d=$3; sub(".*:", "/dev/dm-", d); printf "%s\t%s\t%s\n", p, "/dev/mapper/"v"-"n, d}'
Would like to know if there is any shorter method to get this mapping of... (2 Replies)
hi,
i have a directory at /path/unix with the following files
1.txt
2.txt
3.txt
4.txt
I want to make another file called filenames.txt at a different location called /path/home. So, my output file would be
/path/home/filenames.txt with contents
/path/unix/1.txt... (1 Reply)
Hi All
I've googled around for this and can't see a way of doing it.
I have a file that contains a number of records that are layed out something like the following.
/path/to/directory/that/contains/a/file/I/need/filename.pdf
The path itself can vary both in terms of the names and the... (7 Replies)
Hello,
Given below are 2 sample paths from 2 different servers:
/opt/temp/PROD/Script/New/Letters
/opt/Share/temp/Share1/PROD/Script/Files/New/Letters
I would like to truncate the path till the folder "PROD". Please note that the field count of the folder "PROD" vaires from... (1 Reply)
Hi
In unix able to connect to oracle database and create table ,when rerun ,if table exist ,truncate that table.Any idea how to do that
a.sh
----
sqlplus -s datadmin/password <<EOF
create table xx(col1 number,
col2...
);
exit;
EOF
I... (1 Reply)
I have one file which first line is blank and second line has some data.
$cat filename
output:
30-MAY-07
I want to store 30-MAY-07 value in one variable.
for that I wrote
var="`head -2 filename`"
It will give that result but I want to truncate the first line which is blank.
plz help. (2 Replies)
Is it possibe to use sed for the following? I would like to truncate the output of a directory path if it's over 3 directory levels deep. For example:
/dir1/dir2/dir3 -- NO change required
but,
/dir1/dir2/dir3/dir4 would output as ~/dir4
Thanks. (4 Replies)
Hello everybody it's me again.
I have a procces that is writing in a 'file1' automatically but i want to truncate 'file1' to a filesize 'x' that mean if the 'file1' size is 'x' i want to delete the first lines while the last lines are being writed, that have sence?
in the process are an... (1 Reply)
what does this command do ? as in
does this command just make sure everything in the file is executed?
or does it flush the file?
Actually this is used on a file in a progress database but I believe it is a unix command? (2 Replies)