I am very new to UNIX shell scripting and I am trying to understand the following code. I know what it does but I need to modify it so it will allow me to pass a file name as *FILENAME*
Thank for any guidance offered.
Last edited by bartus11; 08-28-2014 at 05:50 PM..
Reason: Please use [code][/code] tags.
That code snippet checks if the variable type holds the string "file", if so it checks if the variable file starts with the string contained in the variable sourcefile, if so it strips what windows/DOS calls the "extension" including the dot, and then checks the length of the result; if greater or equal a defined minimum, trying (but failing) to increment the variable filecount and add the contents of the variable file to the variable filelist; if less than it logs this info somewhere.
Without way more context it's impossible to answer your question.
The connection between the variables type and file is not known, nor do I see where your *FILENAME* comes into play and what you want to achieve with it...
Here is a bit more of explanation of what I am trying to do. Currently when the script is executed a file name parameter (LTRPRT*) is passed and as you mentioned, checks and makes sure the files exists and are at least the minimum length. Then it takes both of the bellow shown files and FTP them to a specified server. However, I am in need of only checking and sending one of the files. I have tried passing as a parameter
(*CIR-RISKYREM*) or (LTRPRT*CIR-REISKYREM.LTR) and both files keeps getting send over. So I figured the code I placed was the culprit and needed to be modified.
Thanks again and enjoy your day...
---------- Post updated at 08:57 AM ---------- Previous update was at 08:45 AM ----------
Sorry RucyC, I meant to say that when I tried to pass such parameter values, none of the files gets send over and gives me and exception error handling message saying there are no files to send.
Last edited by rbatte1; 08-29-2014 at 11:55 AM..
Reason: Added CODE tags
Please help me to understand the below 3 lines of code.execute shell in jenkins
1)APP_IP=$( docker inspect --format '{{ .NetworkSettings.Networks.'"$DOCKER_NETWORK_NAME"'.IPAddress }}' ${PROJECT_NAME_KEY}"-CI" )
2)HOST_WORKSPACE=$(echo ${WORKSPACE} | sed... (1 Reply)
Unix script coding help?
i am trying to write a code that will display following menu to user:
(A) Add
(B) Subtract
(C) Multiply
(D) Divide
(E) Modulus
(F) Exponentiation
(G) Exit
Then ask user for choice (A-F). After taking users choice ask user for two numbers and
perform... (3 Replies)
Hello,
Can someone please help me understand the shell script below for installing Jboss EAP 6? It is from jboss-as-standalone.sh, what does the highlighted code mean?
# Load Java configuration.
&& . /etc/java/java.conf
export JAVA_HOME
Thanks! (4 Replies)
I have a file f1.txt that contains string:
f1.txt
aaa
bbb
ccc
...
I want to write code to search that each string in file f2.txt(this file contains 1000+line codes).
file f2.txt
..
..
....aaa...xyz..
...
...
...ppp...
(dots . can be characters ot blank spaces)
If particular... (2 Replies)
Hi All,
I have a unix old script i but i am not able to understand the few commands in it and what it does. below is the script.
if ;
then
for F in $(find $DIR/. ! -name . -prune -name "DP_*.dat")
do
IN=${F##/*/}
OUT='ORD'$(echo $IN | cut -c7-)
exec.ksh $IN... (2 Replies)
I do not claim to be an expert, but I have done things with scripts that whole teams of folks have said can not be done. Of course they should have said we do not have the intestinal fortitude to git-r-done.
I have been using UNIX actually HPUX since 1992. Unfortunately my old computer died and... (7 Replies)
Hi,
I need to understand the following script:
a=`dirname $0`
b=`uname -s`
if ; then
c=$a/../../../platforms/$b/extlib
else
c=`pwd`/$a/../../../platforms/$b/extlib
fi
There are a bunch of variable assignments going on here!!!
What does this variable means: "${a:0:1}"
... (2 Replies)
Given this one long stream of data (all one line):
<TransactionDetail><TransactionHeader><ErrorLogging>YES</ErrorLogging><HistoryLogging>YES</HistoryLogging><ErrorDetection>NO</ErrorD... (4 Replies)