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 strongm 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. danhodges99

    Batch File Programming: Date and Date Format

    Hi all, I'm after some help with getting output from what I assume would be the %DATE% and %TIME% variables and manipulating it. Basically, I want to run a series of command and put it in a file with a timestamp as the file name, like this for example: output.27Oct05.1606.txt How would I get...
  2. danhodges99

    Removing Letters from an Integer String

    Hi all, I have a variable, on some machines it is '1024', which is fine, but on others it is '1024Mb' etc. I need this variable to simply be '1024', does anyone know how I could ensure this is always the case? Perhaps a command to remove any letters/characters that aren't integers if there is...
  3. danhodges99

    Cut Final 2 Characters of String

    Hi all, I need to get rid of the final two characters of a string, eg: myString='14504' mymyNewString='145' If you see what I mean... The string will be ever changing, so an't just chop out the '04', needs to be the last two characters, any help is greatly appreciated!
  4. danhodges99

    Run ksh script from CGI

    Howdy, I'm developing a system which requires me to run a ksh script from within a cgi script. What sort of syntax will I need to do this, I'm sure it's simple but can't find out how anywhere! Thanks.
  5. danhodges99

    Run ksh script from within CGI

    Howdy, I'm developing a system which requires me to run a ksh script from within a cgi script. What sort of syntax will I need to do this, I'm sure it's simple but can't find out how anywhere! Thanks.
  6. danhodges99

    Removing the Last Character in a String

    Thanks guys, most helpful!
  7. danhodges99

    Removing the Last Character in a String

    Hi, I need to put the single line contents of a file into a variable, but remove the last character, for example the file would have this sort of contents: 2;4;3;10;67;54;96; And I want the variable to be: 2;4;3;10;67;54;96 (notice the last ";" has gone). Unfortunately I can't...
  8. danhodges99

    Moving Data from a Column to a Row/String

    Hi all, I have a file with several columns of data, eg: A B C D --- --- --- --- 1 2 5 1 2 2 2 2 8 4 4 4 4 2 3 4 10 9 4 4 9 7 1 2 I need to get the values from, say, column B and place them into a string separated by a semicolon, eg: 2;2;4;2;9;7 Does...
  9. danhodges99

    onClick, onMouseover, onMouseout Together!

    Hey guys, I'm designing a site. I can get these commands to work, but never all together! Eg I wish to have a blue button to start with, which changes red onMouseover, then changes to a new button when clicked, then back to the original. Any Ideas? Much appreciated.
  10. danhodges99

    Linux Swap Problem

    Hey all, We have a small desktop PC running RedHat 8. This works fine, but we had major performance probs due to swap being on the same HD. We added a second HD, and would like to put swap on this disk only, but can't find an option in the RedHat OS to specify where to put a swap area. Does...
  11. danhodges99

    Integer/Float Problem

    No problem guys, got it! In case anyone needs to know, you can just bung the variable into a temp file and do a wc -m ${TEMPFILE} which gives you the total characters in the file. Ta anyways.
  12. danhodges99

    Integer/Float Problem

    Hi, I have a script which takes a value from a file and performs calculations on it. Trouble is that this value is a float not an integer and it errors at the decimal point! eg. 94.62 I would like to be able to detect the length of the float (in this above case, 5 characters), and simply do a...
  13. danhodges99

    Day of Year

    You could simply say: if (( $DAY_OF_YR < 100 )) then DAY_OF_YR=$DAY_OF_YR|cut -c2-3 if (( $DAY_OF_YR < 10 )) then DAY_OF_YR=$DAY_OF_YR|cut -c3 fi fi It's a bit of a phaffy way around it, but it (or something like it) will work.
  14. danhodges99

    Weird Problem???

    I have a problem I don't understand... I am trying to declare a variable, and then output the results of that variable, couldn't be simpler #!/bin/ksh VAR='Oranges' if [ ${VAR}='Lemons' ] then echo &quot;Found Lemons&quot; elif [ ${VAR}='Oranges' ] then echo &quot;Found Oranges&quot...
  15. danhodges99

    System Monitoring

    Hi, In UNIX, the sar -c command gives you the number of system calls initiated in the last x minutes. The same command on Linux gives totally different info. Are there any packages/add ons, or does anyone know the command to get system calls in Linux? Thanks.
  16. danhodges99

    Sar question

    Cheers guys!
  17. danhodges99

    Sar question

    Hi all, With Sar, it gives you the CPU usage for the last x minutes etc, does anyone know if this is an average value when the machine in question has multiple CPU's, or simply just a reading of CPU #1? Ta.
  18. danhodges99

    Sed question

    Hi, I need to place a line of text into a file at a certain point, and I have been using: sed ' /theWord/ { atheNewLine }' < sourceFile > newFile This works a treat, trouble is that it adds theNewLine underneath EVERY occurrence of lines containing theWord. Does anyone know a way to simply...
  19. danhodges99

    Sed problem , please help!

    Thanks all of you, I got it sorted now :) Dan.
  20. danhodges99

    Sed problem , please help!

    Hi, I need to insert a line into a file underneath an existing line in the file, but am unsure as to the syntax. I'm pretty sure sed can be used though, although any ideas are more than welcome. For example: File ---- Line 1 Line 2 Line 3 Line 4 Line 6 I need to say: Insert...

Part and Inventory Search

Back
Top