Results 1 to 5 of 5

Thread: unix command expert here ?

  1. #1
    Senior Member registered user
    Join Date
    Mar 2003
    Posts
    872

    unix command expert here ?

    Just want to ask if there is readily available command to 'cut out' a part of a file, say from offset 12345 till end of file ?

    another similar problem, any readily available command to 'grep' the first string occurrence in a file and return its offset.

    I know I can write a perl script for that but just wondering if there is already something in the standard tool set.

  2. #2
    Senior Member registered user
    Join Date
    Nov 2002
    Location
    USA, IL
    Posts
    1,041

    Re: unix command expert here ?

    --See ' man dd ' (sorry, I haven't done this application myself so all I can do is point.)

    See ' man grep ' -- ' grep -b ' will do exactly this.

    Quote Originally Posted by garyng
    Just want to ask if there is readily available command to 'cut out' a part of a file, say from offset 12345 till end of file ?

    another similar problem, any readily available command to 'grep' the first string occurrence in a file and return its offset.

    I know I can write a perl script for that but just wondering if there is already something in the standard tool set.

  3. #3
    Senior Member registered user
    Join Date
    Mar 2003
    Posts
    872
    thanks, the 'grep -b' option only works if the input is considered to be text and in my case it is binary and grep only want to say "match/not match"

    Anyway, it seems to be pretty easy in perl so I went that route.

  4. #4
    Senior Member registered user
    Join Date
    Nov 2002
    Location
    USA, IL
    Posts
    1,041
    --Cool. If you could post your code, it might be of help to others...

    Quote Originally Posted by garyng
    thanks, the 'grep -b' option only works if the input is considered to be text and in my case it is binary and grep only want to say "match/not match"

    Anyway, it seems to be pretty easy in perl so I went that route.

  5. #5
    Senior Member registered user
    Join Date
    Mar 2003
    Posts
    872
    perl -e '$/="---unique seperator---";$i=0; while (<>) { print $_ if ($i++);}' combined_file

Similar Threads

  1. look i got windows 95 on unix under xp rofl screenies
    By jimbob in forum General Support
    Replies: 3
    Last Post: 06-17-2005, 10:01 AM
  2. Internet Explorer 4 for Unix
    By Simon_Haddad in forum Hdd Install / Debian / Apt
    Replies: 5
    Last Post: 04-10-2004, 11:05 PM
  3. Spamassassin expert here ?
    By garyng in forum General Support
    Replies: 0
    Last Post: 06-12-2003, 08:38 AM
  4. Replies: 3
    Last Post: 03-22-2003, 02:42 AM
  5. Misc. Installations: Seismic Unix/gnuplot
    By g-ahmadi in forum The Lounge
    Replies: 1
    Last Post: 03-21-2003, 12:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Knoppix NSM 1.2 picture

Knoppix NSM 1.2

$6.40



Hamshack Live DVD-ROM picture

Hamshack Live DVD-ROM

$8.00



Knoppix Live GNU Linux System 9.1 on Bootable CD / DVD / USB Flash Drive picture

Knoppix Live GNU Linux System 9.1 on Bootable CD / DVD / USB Flash Drive

$9.99



Linux Knoppix 4.0.2 Installation Disc picture

Linux Knoppix 4.0.2 Installation Disc

$29.99



KNOPPIX 9.1 LINUX INSTALL & LIVE DVD picture

KNOPPIX 9.1 LINUX INSTALL & LIVE DVD

$9.99



Knoppix Linux Bootable OS v8.6

Knoppix Linux Bootable OS v8.6 "Original Live Operating System" 16G USB Stick

$19.95



Acer Aspire One 9 inch Netbook ZG5 512MB RAM 8GB SSD HD Knoppix Linux WiFi VGA picture

Acer Aspire One 9 inch Netbook ZG5 512MB RAM 8GB SSD HD Knoppix Linux WiFi VGA

$79.99



Knoppix 3.4 Linux installation CD picture

Knoppix 3.4 Linux installation CD

$10.00



Knoppix Linux Bootable OS v8.6

Knoppix Linux Bootable OS v8.6 "Original Live Operating System" 32G USB Stick

$20.30