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 SkipVought 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. vuakhobo

    Need help on how to cut string on a log file

    PHV, Yeah it work great. Thank you very much. Can you kindly explain the for portion of the command?
  2. vuakhobo

    Need help on how to cut string on a log file

    I have a log file that contain a line below from sftp log sftp> ls -lrt drwxr-xr-x 1 22802 118581 96 Sep 12 12:24 sshkeys -rw-r--r-- 1 0 0 2 Sep 28 17:48 epsout.Hi there you.txt sftp> exit Because there is a space in filename, my command below failed cat...
  3. vuakhobo

    how to parse data with || as delimeter

    Thank you Feherke, it works great.
  4. vuakhobo

    how to parse data with || as delimeter

    Thank you for feherke for helping me but I still have problem getting individual value. I have a test file with contains the content as follow aaa||bbb||cccddd333||111 when I run awk -F '||' '{print $1}' test2.dat it gave entire string back. How can I get individual value?
  5. vuakhobo

    how to parse data with || as delimeter

    Hello expert, I have file with || as delimeter I need help how to parse data with || as delimeter cat test1|cut -d'||' -f1 <- is not working. is there a way to get it done?
  6. vuakhobo

    Is there a better way do this?

    I have a job_list.dat contains say 5 jobs (a b c d e) if job b failed at first run I want to produce a re_run.dat only contains 4 jobs (b c d e) I have written a code below. Can some one show me to do the same thing in awk ? Here is my code set -A list $(cat $job_list) a=0 while [ "$a" -lt...
  7. vuakhobo

    Is there a better way do this?

    I found another solution grep -w will work as well start-id =$(grep -w start inputfile|awk '{print $1}')
  8. vuakhobo

    Is there a better way do this?

    My grep commands are working but is there a better way to do this? inputfile has start3 start start123 start3 startuser changeme start3 hello donut start-id=$(grep start inputfile|grep -v startuser|grep -v hello|awk '{print $2}') start-pass=$(grep start inputfile|grep -v startuser|grep -v...
  9. vuakhobo

    Is there a better way approach this?

    I have a very large file that comes to us daily but unfortunately that there is an error and produce quite a bit of reject in the reject.dat file The error is that there is .n after HH:MM:SS where n could be ANY DIGITS I used the command below to grep for the parttern where n has 1 digit grep...
  10. vuakhobo

    Is there a way to check existence file on sftp

    Hello, Is there a way to check existence file on sftp? Thanks in advance.
  11. vuakhobo

    Cut last characters

    This should do the trick as well Descr=hggh12H4 typeset -lR4 last4="$Descr" echo $last4
  12. vuakhobo

    Is there a way to code in ksh to save result into different tab in exc

    Is there a way to code in ksh to save result into different tab in excel ? For example: result 1st run save into sheet1 result 2nd run save into sheet2 result 3rd run save into sheet3 Right now I can only save into one Excel and use cut and paste later in excel to...
  13. vuakhobo

    Text string manipulation

    I found this function on tek-tips and it works great. function Is_Oracle_OK { if print " select dummy||'OK' from dual; " | sqlplus -s $APP_USERNAME/$APP_PASS@$SID | grep -q XOK then return ${UP} fi return ${DOWN} }
  14. vuakhobo

    Looping checking for byte count

    ahhhhh" for loop. I got it. Thank you PHV. It works great.
  15. vuakhobo

    Looping checking for byte count

    GOAL: 1.Monitor remote server's folder for file(s) 2.Check and make sure file is completely copy over to the folder before sftp to another server. Here is my reasoning. 1. Take a snap shot at current folder for list of file(s). (say we have 3 files) 2. Base on that list, get 2 reads of...
  16. vuakhobo

    SSH Scripting.

    try ssh-agent sh -c 'ssh-add' < /dev/null && bash' this will start the ssh-agent, add your default idenity(prompting you for your passphrase), and spawn a bash shell. From this new shell you should be able to ssh user@hostname
  17. vuakhobo

    Cron: run first Thursday of every month

    Is there a way to set job to run first Thursday of every month? I found this on other thread and wonder if it is correct? 0 2 * * 4 [ `date '+%e'` -le 7 ] && run_script.sh
  18. vuakhobo

    awk -F: '{ print length() }' test.dat | sort -u

    I found my answer: run in linux: awk -F: '{ print length() }' $1 | sort --key=1 | uniq -c run in aix awk -F: '{ print length() }' $1 | sort +1 | uniq -c
  19. vuakhobo

    awk -F: '{ print length() }' test.dat | sort -u

    Hello all, I need little help. I have a flat file called test.dat with 4 lines in it: fddkdjfdkdkfkdf ddd fddkdjfdkdkfkdf ddddd when I run awk -F: '{ print length() }' test.dat | uniq -c the result show: 1 15 1 3 1 5 What I really want is if the line have the length increment the count. The...

Part and Inventory Search

Back
Top