LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Shell scripting problem for importing Firefox files (https://www.linuxquestions.org/questions/programming-9/shell-scripting-problem-for-importing-firefox-files-327304/)

montylee 05-26-2005 10:40 AM

Shell scripting problem for importing Firefox files
 
Hi,

I have the Firefox source code (versoin 1.0).

I have made a cross-platform application in which, for running the firefox browser i require most of the files of firefox/bin (binary and library files etc.).

Currently i am using an environment variable which contains the path of the firefox bin directory and the browser runs properly.

For distributing my application, i need to copy most of the files present in firefox bin directory in my application's path.


Problem:

When i run "ls -l" in firefox bin directory, i find that most of the files are links to files in different firefox directories. On "bull-shit Windows", the original files are present in firefox bin directory, so i just copy-paste the files in my application path on windows.

But on *nix systems, links are present instead of files.

Now, i want to write a shell script which can automatically copy the original files from links within directories (and subdirectories) to a destination directory i specify.

I have no idea how to do that.


Could anybody help me???

Thanks in advance!!!


Regards,
montylee

towlie 05-26-2005 10:46 AM

man cp

Maybe the -L option?

eddiebaby1023 05-29-2005 08:49 PM

"cp" will copy the file content, even if the name you give is a symlink.

montylee 05-30-2005 12:04 AM

Thanks for ur help. It worked. The command i used was:


cp -R -L <firefox-bin-path> <dest-path>



Thanks a lot!!!

montylee 06-01-2005 02:15 AM

Hi again.

On HP-UX, cp command doesn't have a -L option. So, how can i copy links.

Any ideas???

eddiebaby1023 06-01-2005 09:23 AM

Quote:

Originally posted by montylee
Hi again.

On HP-UX, cp command doesn't have a -L option. So, how can i copy links.

Any ideas???

cp by default won't copy links, it copies the file to which the link points (which is what you want anyway). I think the -L flag is redundant (unless I'm missing something). It's harder to copy the actual link.:eek:

montylee 06-03-2005 02:52 AM

Hi,

On HP-UX, i tried to use the default cp command without any arguments, but it copied the links instead of original files.

Any ideas on how to copy original files ???


All times are GMT -5. The time now is 07:57 PM.