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 gmmastros 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: *

  • Users: dioid
  • Order by date
  1. dioid

    replacing text in file

    AWK isn't best used to do "inplace" substitutions in files. The closest to that would be something like redirecting the output to a tmp file, and then over-write the original... #!/bin/bash # awk.sh infil="./awk.data" awk '/apple/ { gsub(/red/, "blue") } /berry/ { gsub(/yellow/, "green") }1'...
  2. dioid

    How to add 15 mins to the date format mentioned below

    I don't mind helping with scripts, but, I'm not good at teaching or writing books. There are better sources than me to learn from. Starting with the command line, there is a lot of help and documentation at hand. @commandline Type: help help man man info <command> Tutorials...
  3. dioid

    Help with character sort

    You could use grep, sed, or awk to achieve this... Sed: sed 's/.*\(g.*\)$/\1/g' gg.data | sort -V Awk: awk 'match($0,/g.*$/) {print substr($0,RSTART,RLENGTH)}' gg.data | sort -V output: g1s1 g4s2 g5s1 g15s6 thread80-1459823
  4. dioid

    How to add 15 mins to the date format mentioned below

    I have no idea what I'm doing here. You could try substituting the printf cmd with the nohup call in 2 places... # printf "%s\n" $fld1 nohup ./prox.sh $fld1 > ./prox.log 2>&1 </dev/null & wait
  5. dioid

    How to add 15 mins to the date format mentioned below

    @ pplearnunix46 Just change the output to print fld1. Like so... #!/bin/bash # dates2.sh dat=${1:0:8} tim=${1:(-6):4} fld1=$(date -d "$dat $tim" +'%Y%m%d%H%M%S') printf "%s\n" $fld1 while [ $fld1 -lt $2 ] do fld1=$(date -d "$dat $tim + 15 minutes" +'%Y%m%d%H%M%S') printf "%s\n"...

Part and Inventory Search

Back
Top