Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6733419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:45:59+00:00 2026-05-26T10:45:59+00:00

I am new to bash/awk programming and need your help soon This is hexadecimal

  • 0

I am new to bash/awk programming and need your help soon

This is hexadecimal ouptut of an ipv6 tcp packet captured through tcpdump –

 6000 0000 0018 0620 0000 0000
 0000 0000 0000 0000 0000 0001 0000 0000
 0000 0000 0000 0000 0000 0002 *0026 0026
 0000 0001 0000 0002 {5}412 0065 0034 0000*
 6162 6364    

The {5} specify the tcp packet length in 32-bit words and tcp packet is b/w *s.

 (* and {} are used to clear the question ,they are not 
  present actually in output)

Now I need to extract tcp header from this info using bash/awk script.

I think I need to read file byte by byte upto tcp specified length but don’t know how to do this.

So any idea how can I extract tcp information from the output specified above assume It has been written in a file.

Thanx in advance ..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:46:00+00:00Added an answer on May 26, 2026 at 10:46 am

    Use the awk feature that allows you to set what characters are used for the RecordSeparator (RS) and OutputRecordSeperator (ORS), and use the NumberRecord (NR) var to monitor which part of the rec you print.

    awk '{BEGIN RS=" ";ORS="\n";} { if (NR >20 && NR < 31) print $0}' hexFile
    

    If you give more detail about your file (how does repeating sets of this data look?) and expected output, I can probably make this even more efficient for you.

    I hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to bash scripting so would need your help. I am trying to
I am new to bash so please bear with me if this is a
HI, I'm completely new to Bash and StackOverflow. I need to move a set
I am very new in bash and never coded in before but this task
I need to write a bash script, which spawn a new xterm window and
i am tring to add a new feature to bash and the job need
I'm very new to bash scripting and I'm trying to practice by making this
I'm fairly new to bash so sorry if this is kind of a basic
I am new in binary conversion. I use Python, Bash and AWK daily. I
Iam new to bash script programming. I want to implement a bash script deploymLog

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.