10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi folks,
I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex.
I have a bunch of update statements with all columns in a file which I need to convert into insert statements.
UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Discussion started by: dev123
0 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 have another question I am stuck at :wall:
I have a text file with two columns, like so...
2 0.0627279
3 0.0794451
4 0.108705
5 0.137739
6 0.190394
7 0.217407
8 0.241764
9 0.344458
10 0.460762
I'd like to go through the file line by line until the value in the second column... (3 Replies)
Discussion started by: origamisven
3 Replies
5. Shell Programming and Scripting
Dear All,
I have one problem in my script, awk statement as
1. it is not evaluate the second variable $stake but the first one $channel is being done.
2.I want to assign the whole awk statement to a variable actual_code which is not being executed in my script.
#!/usr/bin/sh
echo "Enter... (3 Replies)
Discussion started by: chinmayadalai
3 Replies
6. 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
7. 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
8. Shell Programming and Scripting
So I have a if statement inside an awk to check if $2 of a awk equals a specific IP but the test fails. So here is what I have.
# !/bin/sh
echo "Enter client ID"
read ID
echo "Enter month (01, 02, 03)"
read month
echo "Enter day (03, 15)"
read day
echo "Enter Year (07, 08)"
read... (6 Replies)
Discussion started by: doublejz
6 Replies
9. Shell Programming and Scripting
Can someone help me out here. I can't get this piece of code to work. i.e. $ALL_EVENTS does not get interpreted in the if brackets. The first part is the code, the second part is the execution of the code. Note: $ALL_EVENTS does equal 2, but there is no value once passed to the if statement. ... (4 Replies)
Discussion started by: jwholey
4 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