My first goal is to write a script that verifies that for each file in one path there is an associated one in another path.
The association is deviated by a distinct 'part' of the filename(s). Therefore I wanted to work with substitution.
Here is what I have so far:
I expected to put every filename reduced by the string 'cutme' to stdout. But it will tell me it has not sufficient privileges. I think it tries to rename the actual filename, but I just want to work with a 'copy'.
How can I work with filenames without actually changing it?
As part of a bash the below line strips off a numerical prefix from directory 1 to search for in directory 2.
for file in /home/cmccabe/Desktop/comparison/missing/*.txt
do
file1=${file##*/} # Strip off directory
getprefix=${file1%%_*.txt}
... (5 Replies)
Data files coming in different names in a file name called process.txt.
1. shipments_yyyymmdd.gz
2 Order_yyyymmdd.gz
3. Invoice_yyyymmdd.gz
4. globalorder_yyyymmdd.gz
The process needs to discard all the below files and only process two of the 4 file names available
... (1 Reply)
Hi,
I have a files in a directory as below :-
ls -1
mqdepth-S1STC02
proc-mq-S1STC01
proc-mq-S1STC02
proc-mq-S1STC03
Whereever i have S1STC i need to copy them into new file with file name S2STC.
expected output :-
ls -1
mqdepth-S2STC02
proc-mq-S2STC01
proc-mq-S2STC02... (3 Replies)
Hi Folks,
Could anyone please point me to the right direction as I have spent so much time on this without luck. :wall:
I have installed Bind on my CentOS 5 server for internal network. The name resolution is working from the server itself only but not from the clients.
--------------... (7 Replies)
Hi,
I want to run a command in bash on files with names as file0001.txt, file0002.txt, file0003.txt and so on. The indices I have to work on are arbitrary like from file0009.txt to file0161.txt. So basically I want a string that can be updated from 0009 to 0010 to 0011 and so on. How can I do... (6 Replies)
Hi all,
I'm pretty new to Shell scripting and I need some help to split a source text file into multiple files. The source has a row with pattern where the file needs to be split, and the pattern row also contains the file name of the destination for that specific piece. Here is an example:
... (2 Replies)
Hi,
I have a data file xyz.dat similar to the one given below,
2345|98|809||x|969|0
2345|98|809||y|0|537
2345|97|809||x|544|0
2345|97|809||y|0|651
9685|98|809||x|321|0
9685|98|809||y|0|357
9685|98|709||x|687|0
9685|98|709||y|0|234
2315|98|809||x|564|0
2315|98|809||y|0|537... (2 Replies)
Sun Solaris Unix Question
Haven't been able to find any solution for this situation. Let's just say the file names listed below exist in a directory. I want the find command to find all files in this directory but at the same time I want to eliminate certain file names or files with certain... (2 Replies)
I have the following directory structure:
/maindir
/maindir/product1/
/maindir/product1/type1
/maindir/product1/type2
/maindir/product1/type3
/maindir/product2/
/maindir/product2/type1
/maindir/product2/type2
/maindir/product2/type3
/maindir/product2/type4
...
I'm able to traverse... (6 Replies)
Hi
How can i dynamically read files names from a list file and execute them from a single shell script.
Please help its urgent
Thanks in Advance (4 Replies)