What is really happening is that even though I have changed the criteria for finding masked files to cycfnm in`ls $filepath/AC3.C*.AC0*.D*.T*.CSV*, I still am getting .txt and .pdf from the source directory and all are being populated into the target
... ... ...
With scripts of this size, it would be MUCH MUCH easier to read your posts and to look at your code if you would attach the source rather than including it in the text. And when you post multiple slightly different versions, please also attach a file containing output from the command:
The filename matching pattern $filepath/AC3.C*.AC0*.D*.T*.CSV* will match filenames that consist of the string AC3.C followed by any string of zero of more characters followed by the string .AC0 followed by any string of zero or more characters followed by the string .D followed by any string of zero or more charactters followed by the string .T followed by any string of zero or more characters followed by the string .CSV followed by any string of zero or more characters in the directory named by the expansion of $filepath (assuming that there aren't any filename matching meta-characters and there aren't any whitespace characters in the expansion of $filepath). I assume that you don't have any files with names that match that pattern and that the command in your script:
Code:
for cycfnm in `ls $filepath/AC3.C*.AC0*.D*.T*.CSV*` ##After files transferred, remove null chars
produced a diagnostic message similar to :
Code:
ls: expansion_of_$pathname/AC3.C*.AC0*.D*.T*.CSV*: No such file or directory
(even though you didn't mention that crucial piece of information). So the above command (after command substitution) expands to:
Code:
for cycfnm in ##After files transferred, remove null chars
which will go through the following loop with cycfnm set to the name the name of a file in the current directory for every file in the current directory whose name does not have a period (.) as its first character.
From what you have said, it isn't clear what pattern you need in this ls command, but from some of the following if statements, it is probably something like:
Code:
for cycfnm in $(ls $filepath/*AC0*.CSV) ##After files transferred, remove null chars
If you would have redirected the standard error output into a file when you ran this script and looked at it when it finished, the diagnostics from ls would have stood out clearly.
If you can't figure out what is going wrong (especially in a script this size) you need to learn how to use set -xv and set +xv to turn tracing on and off while you're debugging portions of your code.
No, I don't need any more information. I suggested several tools you could use to find your problem. Giving me a list of files that your script modified was not one of those tools.
We are happy to help you learn how to use UNIX systems; we are not here to do your job.
If you'd like to hire me to do some work for you, send me a private message with details on what needs to be done, how I can access your system, and what you'll pay for the work.
I have an file which have data in lines as follows
ad, findline=24,an=54,ab=34,av=64,ab=7989,ab65=34,aj=323,ay=34,au=545,ad=5545
ab,abc,an10=23,an2=24,an31=32,findline=00,an33=23,an32=26,an40=45,ac23=5,ac=87,al=76,ad=26... (3 Replies)
Hi guys.
I have a file containing some hosts and their IPs.
host host1 192.168.2.10
host host2 192.168.2.11
host host3 192.168.2.12
I am writing a script where I want to print these values in 1 line. My script looks like
RUNTIME_NODE=`cat hosts.properties | grep host`
for i in... (7 Replies)
Hello ,
I am creating a controlfile of database in linux and below is the error coming:
SQL> CREATE CONTROLFILE REUSE set DATABASE "newdbcln" RESETLOGS NOARCHIVELOG
2 MAXLOGFILES 5
3 MAXLOGMEMBERS 5
MAXDATAFILES 100
4 5 MAXINSTANCES 1
6 MAXLOGHISTORY... (2 Replies)
Am in need of your help to get the desired output.
nameSECURITY.SERVICES.CONFIG:GETVALUEisPrefetchedNsAccessLast2013-09-13 10:50:13 MESTsAccessTotal1sRunningcHitLastnamePUBLIC.SERVER:INVOKEisPrefetchedNsAccessLast2013-09-17 15:02:05... (5 Replies)
currently I have process from a raw file to this stage
ALTER TABLE "EXCEL_ADMIN"."TC_TXN_VOID" ADD CONSTRAINT "PK_TC_TXN_VOID" PRIMARY KEY ("TC_TXN_IID")
ALTER TABLE "EXCEL_ADMIN"."TC_TXN_AMT" ADD CONSTRAINT "PK_TC_TXN_AMT" PRIMARY KEY ("TC_TXN_AMT_IID")
ALTER TABLE... (10 Replies)
Below is the my cide which is working fine but I am not getting the output indesired format.there is some problem in alignment.Can someone help me to correct this?
if ];
then
summary=$(
echo -e "Please review the log file of auto coloclean utility.\n";
echo -e... (2 Replies)
hi
i am running script which contains the commmnds and i am redirecting the script output to a file.
like
./script 1> result.txt 2>&1
the above redirection is not working for commands when run in background in a script.
but the problem here result.txt containg output which is repeated.... (3 Replies)
Hi,
I have a script in which an entry like this .....
FILENAME_B="PIC_${DATE}0732*.JPG"
The script connects to an ATM and pull a pic file from it.The format for the file is like PIC_2008061400000001.JPG in the ATM.
Means 1st 8 digit is the date(YYYYMMDD) field
2nd 8 digit means hrs... (2 Replies)
I wanted to put "|" this sign at starting and at end of every field but its not working with first field like
Currently the out put is :
abc | abc | abc |
xyz | xyz | xyz |
But I want the out put in this form:
| abc | abc | abc |
| xyz | xyz | xyz |
plz help me. (2 Replies)