make a script!
There is a file with the contain:
A: /usr/bin/A 100k B: /usr/share/B 200k C: /usr/local/src/C 150k P.S. A,B,C are files I wanna write a script , making the same directory structure with that. And A,B,C files are at their mapping place. Could somebody tells me how??? Below is my thinking... === #!/bin/bash contain=`cat file` for i in contain;do mkdir...cp ... <--- I am annoying~~~ >_< done Please give me a hand! Best Regards, Diego |
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 |
Quote:
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? |
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 ? |
Quote:
^_^ |
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 |
Quote:
One is for convenience , the other is for practicing skills. ^_^ |
Code:
cd /usr/ |
All times are GMT -5. The time now is 06:25 AM. |