10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have multiple requirements to run data extracts (with the same basic requriement / resulsts) however the parameters of the extracts change with each request. To help make life easier I am writing a script where the parameters for the specific request are set at the start and then used as needed.... (6 Replies)
Discussion started by: meike
6 Replies
2. Shell Programming and Scripting
Hi,
I am tasked to modify soem script and I come accross a line which I dont fully understand. I tried searching online but I couldnt get a good explanation on it.
Here it the part of the code:
PAY_RT=`cat $TEMPFILE | cut -f2 -d","`
if ;
then
PAY_RT=R
fi
What is... (3 Replies)
Discussion started by: The One
3 Replies
3. Shell Programming and Scripting
My first then statement is executing even though there is no match between the variables. each subsequent if then statement is also executing.
Why do they execute when there is no match in the dates?
yr=`date +%y`
date1=12-31-$yr
date=`date +%m-%d-%y`
set -vx
if ;
... (6 Replies)
Discussion started by: bash_in_my_head
6 Replies
4. Shell Programming and Scripting
i want to select a variable created and use it in a if statement, but not getting the desired results
LINE='device for 0101a01: lpd://172.25.41.111:515'
prt=`echo $LINE | awk '{print $3 }' | cut -c 1-7`
echo $prt
My if statement to select just what i want..
IFS=$":"
while read prt... (11 Replies)
Discussion started by: ggoliath
11 Replies
5. Shell Programming and Scripting
I am trying to assign an select statement into a variable. Can someone hel me with this.
example :
a='select * from dual'
echo $a should give me select * from dual
But this is not working. I trying with \ before * and quotes too. (1 Reply)
Discussion started by: rdhanek
1 Replies
6. Shell Programming and Scripting
Hi,
The following command runs on in the Korn shell prompt. however i want to output the value of this to a variable. Can anyone provide a solution?
echo 'ABC,DEF,"G,HI,J",KLM,"MNi,O"'| awk -F "\"" '{for(i=1;i<=NF;i++){if(i%2)gsub("\,","~^~",$i)}}1' (2 Replies)
Discussion started by: ladarlsan
2 Replies
7. Shell Programming and Scripting
exam is a ksh script. In command line I enter: exam 3 param_2 param_3 param_4.
In exam how can I get the value of the parameter which position is specified by the first argument.
Simply doing this DOES NOT work:
offset=$1
value=$$offset
can you figure out any possible way to interpret a... (5 Replies)
Discussion started by: i27oak
5 Replies
8. Shell Programming and Scripting
Hello, i'm unable to write a correct if... statement to evaluate the $? variable.
Could anybody send to me an example? for example, this lines of code didn't work...
if ; then
etc etc
if ; then
etc etc
Thank you in advanced. (5 Replies)
Discussion started by: aristegui
5 Replies
9. UNIX for Dummies Questions & Answers
Hi all,
I am a newbie, so please let me know if there is a better way to do this. I coded a perl script, that scans a Unix script and picks out certain strings (strings that precede ".log"). However I want to limit the strings it picks up based on the "If statements" in the unix script.
... (0 Replies)
Discussion started by: syera123
0 Replies
10. Shell Programming and Scripting
I want to do this:
Ex 1:
case $answer in
1|2|3|4|5) echo $answer;;
x) break;;
*) echo "Invalid selection. Try again.";;
esac
But I need the part "1|2|3|4|5" to be fetched from a variable, like so:
Ex 2:
case $answer in
$cases) echo $answer;;
x) break;;
*) echo "Invalid... (2 Replies)
Discussion started by: fialia
2 Replies