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 bkrike 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. hlyeoh

    using perl -pi -e in shell script

    I was actually thinking why i can't get the same result using sed? Can sed use to substitute? sed -i 's/${old_seq}/${new_seq}/g' ${SEQ_FILE} to replaces this statement perl -pi -e "s/${old_seq}/${new_seq}/g" ${SEQ_FILE}
  2. hlyeoh

    Leading 0

    yes, it works terrific !! Thanks Annihilannic and Feherke for the suggestion.
  3. hlyeoh

    using perl -pi -e in shell script

    Thanks Annihilannic, the problem solved. It is due to the pipe. new_seq=${seq_code}"\\|"${t_seq_number_new} perl -pi -e "s/${old_seq}/${new_seq}/g" ${SEQ_FILE}
  4. hlyeoh

    using perl -pi -e in shell script

    it works fine. Now it is updated, but it duplicate the result. original : Avnet FFS|00000000001 Avnet SCS|00000000001 After execute: :::::::::::::: ref_id.dat :::::::::::::: Avnet FFS|00000000002|Avnet FFS|00000000002 Avnet SCS|00000000001
  5. hlyeoh

    Leading 0

    Hi Feherke, The number must only be limited to 11 and not increasing length. But thanks for the feedback.
  6. hlyeoh

    using perl -pi -e in shell script

    hi, do you mean like this? perl -pi -e 's./${seq_detail}/${new_seq}/g' ${SEQ_FILE}
  7. hlyeoh

    using perl -pi -e in shell script

    Hi, Is there anyway to use variable in the following case? The file is not able to update. perl -pi -e 's/${seq_detail}/${new_seq}/g' ${SEQ_FILE} alternatif, i try to use sed, but still the file is not updated. sed -n -e 's/${seq_detail}/${new_seq}/g' ${SEQ_FILE} Can anyone help to...
  8. hlyeoh

    Leading 0

    Thanks. I need to ksh in this case. If anyone knows other than using ksh, please tell me.
  9. hlyeoh

    Leading 0

    Hi I am looking for a way to shorten the following script, is there any other options?Thanks. if [ $t_seq_number -le 9 ] then t_seq_number1="0000000000"$t_seq_number else if [ $t_seq_number -le 99 ] then t_seq_number1="000000000"$t_seq_number...
  10. hlyeoh

    Block Storage Bin Function Module

    Hi, May I know is there any function module that I can call in my program to block storage bin? Thanks.
  11. hlyeoh

    AWK questions

    Thanks all :) It works!! However,there is some error in your statement,PHV.
  12. hlyeoh

    AWK questions

    This is my test usage of awk and I face the error of "illegal statement". I don't really where goes wrong? can anyone help? Thanks. #! /bin/sh temp="temp" cat test.dat |awk \ 'BEGIN {FS="|"} { if [$14 != ""]; then team_name=$14 else...
  13. hlyeoh

    Refresh Command (simulate to enter key)

    great idea. I put extra sleep 5 and it works now.Thanks Annihilannic :)
  14. hlyeoh

    Refresh Command (simulate to enter key)

    This is the script that i have written :: I have tried to use & to let it process in background mode, but still i need to press enter to end executing the script and go back to my unixprompt. start_informatica(){ cd /apps/dm/informatica/repositoryserver/ pmrepserver & sleep 20 cd...
  15. hlyeoh

    Refresh Command (simulate to enter key)

    Do anyone knows what is the refresh command (that simulate enter key) that can be used in shell scripts? I have a shell script, so whenever after executing the script, I need to press ‘enter’ to get back the unixprompt … or else the system will still stay there.
  16. hlyeoh

    solve the read date problem

    the result is as below : -rwxrwxrwx 1 devtest bsp 9 Aug 2 04:05 GROSS_BILLINGS_last_mdate.tok but i just need to grep the date,and not the full path. The date should return me the value 20040809 .. anyway, thanx for the help. =)
  17. hlyeoh

    set Flag "importance" in mail -s

    Capoerista (Programmer) Hi, i have tried to find the solution and this is how i have done it and just to share with you and those that might need it. unix provide a useful feature which is /usr/lib/sendmail echo "To:$email" > mesg...
  18. hlyeoh

    solve the read date problem

    thanx for everyone .. it works for me now =)
  19. hlyeoh

    solve the read date problem

    i have the following script to read the date for a file : - get_mdate.awk { timestamp = substr($0, 42, 12) month = substr(timestamp, 1, 3) day = substr(timestamp, 5, 2) thisyear = substr(todaydate, 1, 4) thismonth = substr(todaydate, 5, 2) if (month == "Jan") { monthnum = "01" }...
  20. hlyeoh

    set Flag "importance" in mail -s

    Does anyone know how to set flag "importance" when using mail -s "meeting" abc@outlook.com < meeting.notice? The importance flag is expected to be able to highlight the importance of the email when I read from outlook inbox. thanx

Part and Inventory Search

Back
Top