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

  • Home
  • SEARCH
  • 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 6707991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:42:20+00:00 2026-05-26T07:42:20+00:00

I have a file with function signatures like this: void something(float a, int b,

  • 0

I have a file with function signatures like this:

void something(float a, int b, char c);

Using shell scripts or similar how would you process this, so as to end up with:

float int char

  • 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-26T07:42:20+00:00Added an answer on May 26, 2026 at 7:42 am

    Would this work? I had to do a bit of gymnastics with the IFS variable and some for loops, but it seems to work fine for me. If some of the “void” lines have leading spaces or tabs, you’ll have to adjust the sed expression however…

    test.txt

    void something(float a, int b, char c);
    void something_else(string s, int p);
    void test(float test);
    void tata(string k);
    void foobar(float a, int l, char e);
    

    test.sh

    #!/bin/bash
    filename=$1
    OLD_IFS=$IFS
    IFS=$'\n'
    trap "rm -f $$.tmp" EXIT SIGHUP
    for line in $(egrep -i "^void\ " $filename | sed -e 's/^void \w*(\(.*\));/\1/'); do
            IFS=,
            for s in $line; do
                    echo $s | awk '{print $1}' >> $$.tmp
            done
            IFS=$'\n'
    done
    IFS=$OLD_IFS
    sort $$.tmp | uniq | tr "\n" " "
    echo
    exit 0
    

    Result:

    $ ./test.sh test.txt
    char float int string
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have function whose signature is something like so: void someFunc(ifstream ifile) { This
I have this function to read in all ints from the file. The problem
I have a function called: void initializeJSP(string Experiment) And in my MyJSP.h file I
I have some jQuery code. I have called an Ajax function file, file.php, that
I have a PHP file with one simple echo function: echo 'アクセスは撥ねりません。'; but when
I have a Function in CFC file, which will be called from .cfm file
I have a function in a class file called auth_user and its in App_code
I have a function Load() in a js file which I added to the
I have a function that automatically exports a table into a CSV file, then
I have a function TRANSLATE which reads value from the xml file based on

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.