LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 05-26-2005, 09:40 AM   #1
montylee
Member
 
Registered: May 2003
Location: India
Distribution: Ubuntu 7.04, Fedora Core 9
Posts: 168

Rep: Reputation: 30
Question 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
 
Old 05-26-2005, 09:46 AM   #2
towlie
Member
 
Registered: Apr 2004
Location: U.S.
Distribution: slackware 10.0
Posts: 110

Rep: Reputation: 15
man cp

Maybe the -L option?
 
Old 05-29-2005, 07:49 PM   #3
eddiebaby1023
Member
 
Registered: May 2005
Posts: 378

Rep: Reputation: 33
"cp" will copy the file content, even if the name you give is a symlink.
 
Old 05-29-2005, 11:04 PM   #4
montylee
Member
 
Registered: May 2003
Location: India
Distribution: Ubuntu 7.04, Fedora Core 9
Posts: 168

Original Poster
Rep: Reputation: 30
Thumbs up

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


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



Thanks a lot!!!
 
Old 06-01-2005, 01:15 AM   #5
montylee
Member
 
Registered: May 2003
Location: India
Distribution: Ubuntu 7.04, Fedora Core 9
Posts: 168

Original Poster
Rep: Reputation: 30
Hi again.

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

Any ideas???
 
Old 06-01-2005, 08:23 AM   #6
eddiebaby1023
Member
 
Registered: May 2005
Posts: 378

Rep: Reputation: 33
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.
 
Old 06-03-2005, 01:52 AM   #7
montylee
Member
 
Registered: May 2003
Location: India
Distribution: Ubuntu 7.04, Fedora Core 9
Posts: 168

Original Poster
Rep: Reputation: 30
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 ???
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Scripting and Files With Spaces Matir Programming 12 08-17-2005 01:43 AM
command line options for firefox for shell scripting. dr_zayus69 Programming 1 05-25-2005 11:36 AM
Shell Scripting: How to pick lines out of files by line number. Louie55 Programming 3 03-22-2005 06:18 PM
shell scripting: checking for modified files topcat Linux - General 4 12-08-2004 04:43 AM
Does anyone know how to move files to a particular directory using shell scripting RowanB Programming 3 11-11-2004 01:46 PM


All times are GMT -5. The time now is 09:16 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration