Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by buccaneers

  1. buccaneers

    Is there a way to search non-numeric charaters with in a variable..

    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.
  2. buccaneers

    Is there a way to search non-numeric charaters with in a variable..

    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...
  3. buccaneers

    Is there a way to search non-numeric charaters with in a variable..

    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...
  4. buccaneers

    replacing ":" with "_" in a string using nawk...

    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
  5. buccaneers

    replacing ":" with "_" in a string using nawk...

    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
  6. buccaneers

    Help...

    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...
  7. buccaneers

    getting error in ksh..

    I am sorry. i should hv posted this. Anyways I think i just resolved the issue. Thx for reply to the post.
  8. buccaneers

    getting error in ksh..

    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
  9. buccaneers

    how find if a stirng is a part of a variable....

    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...
  10. buccaneers

    how find if a stirng is a part of a variable....

    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.
  11. buccaneers

    how find if a stirng is a part of a variable....

    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
  12. buccaneers

    how find if a stirng is a part of a variable....

    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...
  13. buccaneers

    looping thru' a string within a variable...

    thank you very much . This works for me. I really appreciate it. Hv a gr8 thx giving.
  14. buccaneers

    looping thru' a string within a variable...

    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,
  15. buccaneers

    How find files that are more then certain days ?

    Thx PHV. Is there any other way to get this list ? TIA, LN

Part and Inventory Search

Back
Top