Linux / UNIX Tech Support Forum
This is a discussion on extract the path within the Shell scripting forums, part of the Development/Scripting category; After running find command for a file i get ./db_app/crm_ace_sync/billing_recovery/ace/cfg/tx_update_address.ctl but i want to store in a variable address starting ...
|
|||||||
| Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
After running find command for a file i get
./db_app/crm_ace_sync/billing_recovery/ace/cfg/tx_update_address.ctl but i want to store in a variable address starting from crm_ace_sync i.e path =/crm_ace_sync/billing_recovery/ace/cfg. if i go inside db_app and run for i in `cat ../filelist.txt` do path=`find . -name $i|awk -F"$i" '{print $1}'` ---($i is the loop variable it will give me the answer but the files not necessarily be always inside db_app because under stage there are several other directories which may contain the files. how to do it and i have to do it for a large number of files which i will keep in loop so tell me the method to extraxt that address in that particular manner. |
| Sponsored Links | ||
|
|
|
||||
|
Is string "crm_ace_sync" constant i.e. present in all file names?
__________________
Vivek Gite Linux Evangelist |
|
||||
|
I'm sorry but I don't get you.. may be you can provide more info...
__________________
Vivek Gite Linux Evangelist |
|
|||
|
Quote:
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| shellScript tht to extract the interface name if their HWaddr starts with 00:0C | pooppp | Shell scripting | 0 | 31-07-2008 05:03 PM |
| Change /tmp path on KDE as it is too small for KDE | marccarter0 | Ubuntu / Debian | 2 | 26-05-2008 09:34 PM |
| Script to extract some part of files: | satish1482 | Shell scripting | 0 | 13-03-2007 05:30 PM |
| how to extract zip files in linux | Linux software | 1 | 10-01-2006 11:30 PM | |
| Script to extract a specific row of data | ricc | Shell scripting | 1 | 15-11-2005 02:29 PM |