ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
You provided the destination path for A, B, C files but not the source path...
I mean when you copy a file, it is like :
cp source_file destination_path
now for mkdir :
Code:
#!/bin/bash
for file in $(cat file | cut -d' ' -f2); do
dir=$(dirname $file)
# create dir if it does not exist
[ ! -d $dir ] && mkdir -p $dir
done
Originally posted by keefaz You provided the destination path for A, B, C files but not the source path...
I mean when you copy a file, it is like :
cp source_file destination_path
now for mkdir :
Code:
#!/bin/bash
for file in $(cat file | cut -d' ' -f2); do
dir=$(dirname $file)
# create dir if it does not exist
[ ! -d $dir ] && mkdir -p $dir
done
hmm... i will try it! ^_^
Actually , my goal is to extract the necessary library files for an application.
"ldd application" <--- shows so many relative library files for the application.
I would like to collect them , and put them into the relevent directory.
Here comes another question:
some libraries are sybolic links....
What's the next step?
Originally posted by keefaz I don't get it... If ldd does not show unresolved shared library links, the linked libraries are
in the right place, why do you want to move them ?
Because i want to pack it and move to my embed linux system.
^_^
It is better to compile programs statically in this case (gcc -static option or ./configure options)
this way, the program has library code built into it
Originally posted by keefaz It is better to compile programs statically in this case (gcc -static option or ./configure options)
this way, the program has library code built into it
But,sometimes it came from the public field.
One is for convenience , the other is for practicing skills.
^_^
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.