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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by milage

  1. milage

    DBI Library Sybase Open Client Compilation Issue

    Hi, Although this is possibly caused by sybase it is in perl were I wish to solve the problem so I choose this forum over the sybase one. Ok here goes... I have been having some problems using DBI to connect to a sybase database.... sometimes its all fine, other times it doesn't work and this...
  2. milage

    ^M

    I also encountered this problem recently, check out the suggestions in this thread: http://www.tek-tips.com//viewthread.cfm?spid=822&newpid=822&sqid=398721&CFID=413649&CFTOKEN=34084985 if you have it then the dos2unix works a treat! HTH Rob
  3. milage

    Case statement doesn't cope with values greater than 9?

    Hi, thanks for that excellent suggestion, a nice quick a simple solution thats what I like, now why couldn't I have thought of that! btw, i'm not actually re-choosing on success, there is a whole bunch of code that happens, I just removed it all and replace it with and echo to make the code...
  4. milage

    Case statement doesn't cope with values greater than 9?

    Hi, I have this case statement for which the options change depending on the number of subdirectories in a directory. However, lets say there happen to be 15 subdirectories. This causes the case statement to echo "Invalid choice" if the user enters any values except or 1 and 5...
  5. milage

    sed for string in each file

    Hi, Say I have a directory of files each with a header which looks like this: # # $RCSfile: MF.form,v $ # $Author: david $ # $Revision: 1.46.2.6.2.3.2.4 $ # I want to extract from each file into a variable the long revision number between "$Revision: " amd " $" at the end...
  6. milage

    Not sure what I am supposed to use to do this?

    Ok, I've tried this: echo $string | sed 's`echo "^M"`'//g' and it errored with and EOF so I got rid of one of the ' echo $string | sed 's`echo "^M"`//g' and it doesn't error anymore. However, rather than echoing it out to the screen I need to put it into another...
  7. milage

    Not sure what I am supposed to use to do this?

    Hi, Say I have a string in my shell script and I want to do a find and replace on it what I am supposed to use and how? I have tried using sed (but then realised this was just for files?) and am now a bit stumped. All I want to do is to find all instances of "^m" within a string and...
  8. milage

    Hi, Say I have an array @a_array

    Cheers, thanks for the suggestions. I went for the copying the ones I wanted to keep into a temporary array and then copying this back onto @a_array approach in the end. Rob
  9. milage

    Hi, Say I have an array @a_array

    Hi, Say I have an array @a_array which contain objects which are in turn arrays with 6 elements. I am trying to delete objects from that array whose first element equals an element of another array. So far I have got this far (assume that @a_array and @ignore_variables has been declared and...
  10. milage

    Get list of filenames from file and fetch and tar the files

    Hi, Cheers for that. However, what can I do if they aren't in the path. sample file contains: directory1/directory2/filename directory2/directory3/filename directory3/filename and these are not in the root or the path. So, what I need to do is to add the rest of the path to each filenames...
  11. milage

    Get list of filenames from file and fetch and tar the files

    Hi, I'm kinda new to shell scripts. I have a file which lists a series of filenames. I need to write a script which gets the list of these filenames from the file, and then tars them up maintaining the directory structure. Cheers Rob
  12. milage

    Getting the value of the matched text

    cheers, worked a treat.
  13. milage

    Getting the value of the matched text

    Hi, I have a string variable which I have done some pattern matching on and I want to assign the matched text to a new variable. I have this: $new_variable = $the_string =~ m/^\s*\w+/; However, when the pattern is found this assigns 1 (true) to the new_variable rather than the string itself...
  14. milage

    Extract data from files using pattern matching

    Hi, I have to extract some information using perl from some files and I assume will deal with pattern matching which I am not very experienced with so am in need of a bit of help. Below is a sample of the format of these files, although of course these files are not totally uniform and can have...
  15. milage

    Get All The Current Environment Variables Into An Array

    Hi, I need to write a script which extracts all the currently set envrionment variables into an array of the format { Variable_Name , Variable_Value } Any help would be much appreciated. Rob Miles

Part and Inventory Search

Back
Top