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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

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

    How find files that are more then certain days ?

    Hello Guru's, I have a question if i may ask. I am trying to find files older then certain number of days from current date. I thought you could do this with find cmd, but unfortunatey this is not working for me or i am not using the cmd correctly. I was using following cmd to list files in a...
  17. buccaneers

    How do i do this with awk....

    Thx CaKiwi. I am using solaris. let me try with nawk. Thx Krunek this solution works. Thx PHV the solution works. Really appreciate all of your help. Have a gr8 weekend.
  18. buccaneers

    How do i do this with awk....

    CaKiwi, It isn't working.. i am getting error awk: syntax error near line 1 awk: bailing out near line 1 I just copied your solun into a file adn exec'ed file. I understand you are checking for number of records to 1 from first file and assigning the first record to "a". Then you are trying...
  19. buccaneers

    How do i do this with awk....

    Hello Gurus, I have a question rather i am stuck at this point. I have two files. One containing a single record Jul 8 2004 6:03:00:000PM ~~123456789 ~~13571 And other containing multiple records ~~10001A ~~N ~~123450.0 ~~0.0 ~~10002B ~~N ~~234560.0 ~~0.0 ~~10003A...
  20. buccaneers

    Trapping Return Code from a Sybase Stored Proc

    you may want to redirect the output of sql statement into a log file and then write some error trapping like the code below.. egrep -i "Error|Msg.*Level.*State|CT-LIBRARY error:" LOGS/sql.out >/dev/null if [ $? -eq 0 ] then echo "#**********************DB-ERROR**********************#" >>...

Part and Inventory Search

Back
Top