How are you invoking this script? What is in the files that you are giving your script as operands?
Why haven't you run your script with tracing enabled so you can see exactly what is going on when you are creating the file (or files) that you don't want your script to create?
Given the other 18 threads that you have started that we have been discussing in the last week, is there some reason why we have to keep asking these same questions in every thread you start?
Why is the code issuing a usage message unless exactly two operands are given when the usage message printed says that there should only be one operand AND shows an example that issues two commands (each with a single operand)???
These 2 Users Gave Thanks to Don Cragun For This Post:
Like Don at point 6, 3 hours ago when I saw an error at the second line of a script, it made me wonder if I was fit enough to go through all the code, knowing there might be more errors... after having been at work again today and now dead tired,the answer was no I dont have the strength. So like Don I am wondering why the information you give us the presenting the code is so lacunar, specially when your code sends echoes, why dont you show us the true output, do you really think we are after days of work in the mood of going through the code because you are unwilling to show us the true output, to try to guess what you might have done wrong?
I am using AIX
I put echo statement after each line, but now it is on QA, I cannot have all print statements.
You have asked me to put all lines before, now you ask me, why I put all line? It is really confusing.
In my log file I see the first line
that is why probably I get one incorrect file.
All input files are with different names, but some have xxx_Today date.csv or .txt, some have xxx.Today date.csv or. txt
Hopefully this can help you?
---------- Post updated 03-14-17 at 08:18 AM ---------- Previous update was 03-13-17 at 10:22 AM ----------
May be you are such cool specialist, but I will never get help from you.
Thanks for nothing
---------- Post updated at 07:42 PM ---------- Previous update was at 08:18 AM ----------
Do I understand correctly, that you will not help me with this issue?
---------- Post updated at 07:42 PM ---------- Previous update was at 08:18 AM ----------
Do I understand correctly, that you will not help me with this issue?
No! What you should understand is that I asked you 6 questions in post #2 in this thread and you have still only answered two of those questions.
Your code has lots of echo statements in it. You have not shown us the output produced by any of those echo statements (which might help us understand what your code is seeing while it is running).
We have suggested that you should trace the execution of your script and show us the output produced. You have chosen to keep us in the dark and not provide us with that information.
You have stated that your log file contains the text:
but we can look at the code that you have shown us and unequivocally state that that message was not produced by the code you have shown us.
If we:
don't know what is in the files your code is processing,
don't know what code you are running,
don't know how you are running your code,
and don't know what output your code is producing while it is running,
there isn't much that we can do to help you. If you would like to:
answer our questions,
show us a representative sample of the contents of the files your code is processing,
show us the actual code that you are running when processing the data samples you show us,
show us the output that is produced by your code when processing the data samples you show us,
and run your code with tracing enabled and show us the trace output,
then we might be able to help you track down your problem.
We aren't sitting at your terminal. We can't see the code you are running. We can't see the files that your code is processing. We can't see the output produced by your code. We don't have the data that you have so that we can figure out what your code might do (even if we try to run your code on our own systems). Only you have that information and you have chosen not to help us help you.
We would love to help you, but you have chosen to hide the information from us that we need to be able to help you. Please help us help you.
Hi,
I have created a test script like this :
# cat script1.sh
DAY=$(date +%d)
MONTH=$(date +%b)
YEAR=$(date +%Y)
BC01="Blast_BC01"
BC15="Blast_BC15"
DIR1="$MONTH$YEAR_$BC01"
DIR2="$MONTH$YEAR_$BC07"
DIR3="$MONTH$YEAR_$BC15"
if ;then
mkdir -p "$YEAR/$DIR3"
fi
#
When I... (5 Replies)
I'm fairly new to scripting so this might not be possible.
I am using Expect with Cisco switches and need to capture the string after finding the expect request. For example, when I issue "show version" on a Nexus switch, I'm looking to capture the current firmware version:
#show version
... (0 Replies)
Hi,
I have been programming with the expect program for a while now and have create a series of menu driven checks for the operations team. One thing I have noticed is that I call a remote script and pass parameters and this is display on the screen....for example.
Within the script
... (0 Replies)
I have an expect script called remote that I want to call from inside my expect script called sudoers.push, here is the code that is causing me issues:
set REMOTE "/root/scripts/remote"
...
log_user 1
send_user "Executing remote script as $user...\n"
send_user "Command to execute is: $REMOTE... (1 Reply)
Hi,
Am very new to expect scripting..
Can You please suggest me how to call an expect script inside another expect script..
I tried with
spawn /usr/bin/ksh
send "expect main.exp\r"
expect $root_prompt
and
spawn /usr/bin/ksh
send "main.exp\r"
expect $root_prompt
Both... (1 Reply)
This Expect script provides expect with a list of IP addresses to Cisco IPS sensors and commands to configure Cisco IPS sensors. The user, password, IP addresses, prompt regex, etc. have been anonymized. In general this script will log into the sensors and send commands successfully but there are... (1 Reply)
Hi:
Can anyone help me with the while loop in expect script. Following is my scenario:
1. one of my process is running and looking for a file
2. as soon as the file is dropped the proces then processes the file and creates a control file ".ctl" to indicate end of process for that file
... (5 Replies)
Hello to all...this is my first post (so please go easy). :)
I feel pretty solid at expect scripting, but I'm running into an issue that I'm not able to wrap my head around. I wrote a script that is a little advanced for logging into a remote Linux machine and changing text in a file using sed.... (2 Replies)
Hi,
I have an expect script that logs into a host (via ssh) requests the hostid then exits... I am happy with that.
However how can I run the same script in a kind of 'while read line' and enter lots of hosts? My knowledge is still very limited (as you will soon see) so any other ideas would... (2 Replies)
Noob question ..
My Java based application needs to change some user passwords based on some user actions. Since this application can run on Redhat AS2.1 / AS4.0 / Solaris 9 etc, the most safe and portable solution that I could think of was: Use expect.
Now, expect is not available on all... (1 Reply)