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

    grep -w

    Because it looks for "/nfs_l1 " as a whoole word space included. If you uncote /nfs_l1 , it will ignore trailing spaces
  2. Ogzilal

    How to Split quote-comma delimeted file in unix

    If your column is the last in the file and if you have "rev command" installed reverse twice rev /path/to/file | awk -F"," '{print $1}' |rev and then remove " and ' using sed tr or your favorite tool
  3. Ogzilal

    cronjob issue

    It can be matter if the old crontab contains the same action scheduled at 9:01 and was edited using say vi to change the time at 10:01.
  4. Ogzilal

    cronjob issue

    How did you put this line in crontab ? 1 10 * * 0,2-6 ksh -c "/sitemgr/backup/bkupproc/appbkup.ksh rmt1" By using crontab -e ( which edit and restart cron daemon ) or by editing the underlied file using your favorite editor in which case, you are still using old crontab.
  5. Ogzilal

    unix script using a menu

    At first glance, it looks OK. Repalace Displaymenu with displaymenu in the definition of the function Replace echo `DATE` with date and call your functions in the while loop while true do displaymenu read answer case $answer in 1) do_takeon ;; 2) do_expired ...
  6. Ogzilal

    Delete the files based on the date's

    date --date="-1 month" +%Y-%b-%d 2010-Jan-17
  7. Ogzilal

    Delete the files based on the date's

    If you are using Linux, you can write something like this to get date one month later date --date="-1 month" +%Y-%m-%d 2010-01-17
  8. Ogzilal

    Dynamic variable name

    Same code with reuse X variable Counter=0 while [ $Counter -le 3 ]; do eval X=Input$Counter echo $X eval $X=$(cat /tmp/lst$Counter | awk '{print $1}') eval Y=\$$X echo $Y Counter=`expr $Counter + 1` done
  9. Ogzilal

    Dynamic variable name

    Hi, think eval if you want some pointer behaviour that works in two times Counter=0 while [ $Counter -le 3 ]; do eval X=Input$Counter echo $X eval $X=$(cat /tmp/lst$Counter | awk '{print $1}') eval Y=\$Input$Counter echo $Y Counter=`expr $Counter...
  10. Ogzilal

    increase time by n minutes

    Like this using man seq for details #! /bin/ksh for HH in $(seq 0 23) do for MN in $(seq 0 5 55 ) do printf "%.2d:%.2d\n" $HH $MN done done
  11. Ogzilal

    Using Variable as Array Name

    If you need access to array elements, here is some code going that way #! /bin/ksh for ARRAY in Tab1 Tab2 do # some Array initialisation case $ARRAY in Tab1) eval set -A $ARRAY aaa bbb ccc ddd eee ;; Tab2) eval set -A $ARRAY 111 222 333 444 555...
  12. Ogzilal

    substr string from end of the string

    Hi, Try this code for FILENAME in $(ls *.err ) do echo ${FILENAME%.*.err} done
  13. Ogzilal

    Open file delete lines and close(save) in shell script

    Hi, This grep will discard all DROP lines with a 4 chars tablespace name grep -v "DROP TABLESPACE.......INCLUDING CONTENTS CASCADE CONSTRAINTS" drop.sql > drop.sql_modified 7 dots stands for 2 spaces and 4 chars tablespace name and a space. SYSAUX and SYSTEM will be discarded
  14. Ogzilal

    Script for FTP over SSL

    Hi, I think you mean sftp connections without giving password. If so, google "ssh without password" and surf over displayed links
  15. Ogzilal

    How to list set of installed patchs in sqlplus

    Hi, I am running an Oracle 9.2.0 on AIX box. The installation was made from a tape and I dont have the original set of CDs to run OUI. Is there an SQL command that lists the set of installed patchs In advance, Thanks
  16. Ogzilal

    nesting loop help

    Hi, You can use standard shell arguments as the inner loop # set argument list the second collection set a b c d e for i in one two three four five do echo $i $1 shift #shift argument list to left done
  17. Ogzilal

    Exporting variable

    Hi, You can also use functions inside the same script. cat script1 #! /bin/ksh function script2 { export abc="y" } # end of function script2 # begin of script1 # call function script2 script2 print "abc="$abc
  18. Ogzilal

    Changing file formats

    Hi, Files on unix are text files( scripts) or binary(compiled) files What you call csv is some text file where fields are separated by a comma. You can't change this file to a binary ( say C compiled file ). If you receive a file in a non portable spreadsheet format file ( say xls), you can't...
  19. Ogzilal

    How to compare date and time in IF statement

    Hi, -ge -ne -eq etc are for numeric comparaison. If you want to compare strings, you can use the C like construction. -ge is equivalent to ( not less ) ! is the operator not < is less use [[ boolean expression ]] instead of [ boolean expression ] if [[ ! "${c} ${d}" < "${StartTimeStamp}"...
  20. Ogzilal

    string search and replace

    Hi, X="25.05.2007 04:11:01 PM" echo $X |tr '.' '/' man tr for more info

Part and Inventory Search

Back
Top