Hey Folks and Gurus there
I am trying to replicate this logic in bash :
(1) if ; then
function1 parameters &
function2 parameters &
fi
Is there an easy method esp one with regex that can do this comparision.
e.g. $var is compared to this list ( case regardless ) (... (1 Reply)
Hi,
I am trying to write a script to show the status of a Network card.
Variables:
chosennic is a read variable
statuss=`/sbin/ifconfig $chosennic | grep MTU | awk '{print $1}'`
ipadd=`/sbin/ifconfig $chosennic | grep Bcast | awk '{print $2}' | awk -F : '{print $2}'`... (2 Replies)
Hi,
We Perfrom Loads to the database through a Perl script which generates a statistics file. I need to read the statistics. the Statistics file looks something like below:
Process Beginning - 08-26-2010-23.41.47
DB2 CONNECTION SUCCESSFUL!
Ready to process and load file: FILENAME
# of... (2 Replies)
Hi Champs,
I am a newbie to unix world, and I am trying to built a script which seems to be far tough to be done alone by me.....
" I am having a raw csv file which contains around 50 fields..."
From that file I have to grep 2 fields "A" and "B"....field "A" is to be aligned vertically... (11 Replies)
Can someone tell me how I can do this?
e.g:
a=$(echo -e wert trewt ertert ertert ertert erttert
erterte
rterter
tertertert
ert)
How do i replace the STRING with $a?
I try this:
sed -i 's/STRING/'"$a"'/g' filename.ext
but this don' t work (2 Replies)
Hi ,
I have one file like
BUD,BDL BUDCAR
BUD,BDL BUDLAMP
ABC,CDF,KLT ABISKAR
ABC,CDF,KLT CORNEL
ABC,CDF,KLT KANNAD
JKL,HNM,KTY,KJY JAGAN
JKL,HNM,KTY,KJY HOUSE
JKL,HNM,KTY,KJY KATAK
JKL,HNM,KTY,KJY KOLKA
The o/p should be like
BUD,BDL BUDCAR,BUDLAMP
ABC,CDF,KLT... (4 Replies)
Hello,
I am trying to execute an SQL query from shell script.
A part of script is something like this:
fromDate=`echo $(date +"%F%T") | sed "s/-//g" | sed "s/://g"`
$ORACLE_HOME/sqlplus -s /nolog <<EOD1
connect $COSDBUID/$COSDBPWD@$COSDBSID
spool... (4 Replies)
Hi, coding a simple program to compare an entered number to a randomly generated one. The number of digits are restricted so I'm just trying to figure out how to refer to the index value in a string and then compare it to the variable I want. I don't know if bash automatically indexes strings, so... (7 Replies)
Using ksh, I am using SQLPlus to execute a query with a filter using a string variable.
REPO_DB=DEV1
FOLDER_NM='U_nmalencia'
FOLDER_CHECK=$(sqlplus -s /nolog <<EOF
CONNECT user/pswd_select@${REPO_DB}
set echo off heading off feedback off
select subj_name
from subject
where... (5 Replies)
have a file1
aaa-bbb-ccc-abcd
aaa-bbb-ccc-bacd
aaa-bbb-ccc-aaad
aaa-bbb-ccc-ahave another file2
aaa-bbb-ccc-a fileusing the fgrep command, trying to have only the literal string returned.
fgrep -f file2 file1 is returning
aaa-bbb-ccc-abcd
aaa-bbb-ccc-aaad
aaa-bbb-ccc-aOnly looking for... (1 Reply)
Discussion started by: jimmyf
1 Replies
LEARN ABOUT MOJAVE
while
while(n) Tcl Built-In Commands while(n)
__________________________________________________________________________________________________________________________________________________NAME
while - Execute script repeatedly as long as a condition is met
SYNOPSIS
while test body
_________________________________________________________________DESCRIPTION
The while command evaluates test as an expression (in the same way that expr evaluates its argument). The value of the expression must a
proper boolean value; if it is a true value then body is executed by passing it to the Tcl interpreter. Once body has been executed then
test is evaluated again, and the process repeats until eventually test evaluates to a false boolean value. Continue commands may be exe-
cuted inside body to terminate the current iteration of the loop, and break commands may be executed inside body to cause immediate termi-
nation of the while command. The while command always returns an empty string.
Note: test should almost always be enclosed in braces. If not, variable substitutions will be made before the while command starts execut-
ing, which means that variable changes made by the loop body will not be considered in the expression. This is likely to result in an
infinite loop. If test is enclosed in braces, variable substitutions are delayed until the expression is evaluated (before each loop iter-
ation), so changes in the variables will be visible. For an example, try the following script with and without the braces around $x<10:
set x 0
while {$x<10} {
puts "x is $x"
incr x
}
EXAMPLE
Read lines from a channel until we get to the end of the stream, and print them out with a line-number prepended:
set lineCount 0
while {[gets $chan line] >= 0} {
puts "[incr lineCount]: $line"
}
SEE ALSO
break(n), continue(n), for(n), foreach(n)
KEYWORDS
boolean value, loop, test, while
Tcl while(n)