Thanks dkyrtata, feherke and phv. Really appreciate your responses.
dkyrtata -- Apologies. I typo'ed on $TKT instead of $VAR. then I was multi-tasking and working two scripts.$TKT was variable in the second one. :(
Again thanks a lot to all.
Thx dkyrtata.
I still didn't understand the regex part.
Although following seems to be working
VAR="zp#- 123"
echo $VAR| egrep -v "^-?[0-9]+$" #==> displays $VAR if and only if it has some nonnumeric values
and
echo $TKT | egrep "^-?[0-9]+$" #==> doesn't display $VAR is it has only...
Hello All,
I am stuck at a point where in i am to check for any non-numeric charaters in a variable. Is there a way to do it. I want to avoid using multiple if checks.
Basically i expect a variable to $VAR to contain only numeric values and if it contains any non numeric value it should exit...
Here is what i was looking for and got it.
h:w #find ./src -name "File_Name*" | sort | tail -2 | nawk '{t=$0; gsub(/:/,"_",t); print "mv "$0" "t}'
mv ./src/File_Name:0224:2009:1 ./src/File_Name_0224_2009_1
mv ./src/File_Name:0224:2009:2 ./src/File_Name_0224_2009_2
Cheers,
LN
Hello Guru's,
I have following files
/SourceDir/File_Name:1:0224:2009
/SourceDir/File_Name:2:0224:2009
I want to move them to
/TargetDir/File_Name_1_0224_2009
/TargetDir/File_Name_2_0224_2009
Is there a way i can do this using nawk ?
Your feedback is greatly appreciable.
cheers,
LN
Hello Gurus,
I am new what at awk and easily getting lost. I am stuck now and would really appreciate your help. Here is what I am trying to achieve as output from the input file mentioned below :-
EXPECTED OUTPUT :-
Date Time sylogina1 sylogina2 others Total
Feb 21 2006 12:00AM 2...
Hello Gurus,
I am getting error in the ksh. I tried turning the debug mode on but it gives no info. The same line comes as an error.
the error is
tst_in.ksh[26]: 0403-057 Syntax error at line 100 : `<' is not matched.
Is there a way to get more insight into this.
TIA
Hello Guru's,
now this code is not working. Am i suppose to write individual "case" statements ?
Below is teh code :-
#!/bin/ksh
cl_cd=est
tgt_str=thistestvalue00
ist_flg=0
f_ist=0
f_cl=0
f_00=0
f_01=0
f_sybP=0
f_reg=0...
Never mind. This works...
case $VAR in *${SRC_VAR}*) echo "String found" ;; esac
If i may ask one more question.
Why do i always have to mention "*". Why can i not just specify ${SRC_VAR} ?
Just want to better understand.
TIA.
Thx PHV. this did help a little. But i forgot to mention one thing in my question. This string to be searched is in variable. like SRC_VAR=est.
Is there a way to get around this.
TIA
Hello Guru's,
I have a question. But before i ask i need to give some background
I have a variable say VAR assigned with value say thistestvalue
now i have to find if "est" is a part of $VAR. If so then what is its starting position in the $VAR.
Is there a way to do this in shell script...
Hello Guru's,
I have a string variable. Length of it is variable. With every execution this may change. But once i get a string i need to read thru it one character at a time.
How do i do it ?
I did read a thread posted by "dbadmin", it didn;t work for me.
TIA,
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.