Sponsored Content
Full Discussion: Need some help with this...
Top Forums Programming Need some help with this... Post 302138248 by porter on Sunday 30th of September 2007 05:42:21 PM
Old 09-30-2007
Basically you would be converting the following into C.

Code:
#!/bin/sh

first()
{
        echo $1
}

for n in $@
do
        /usr/bin/alias | while read STR
        do
                NAME=`echo $STR | sed y/=/\ /`
                FIRST=`first $NAME`
                if test "$FIRST" = "$n"
                then
                        echo $STR | sed s/$n=//
                fi
        done

        if test -f $n
        then
                echo $n
        fi

        for d in `echo $PATH | sed y/:/\ /`
        do
                if test -f $d/$n
                then
                        echo $d/$n
                fi
        done
done

 
echo(3XCURSES)						  X/Open Curses Library Functions					    echo(3XCURSES)

NAME
echo, noecho - enable/disable terminal echo SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib -R /usr/xpg4/lib -lcurses [ library... ] c89 [ flag... ] file... -lcurses [ library... ] #include <curses.h> int echo(void); int noecho(void); DESCRIPTION
The echo() function enables Echo mode for the current screen. The noecho() function disables Echo mode for the current screen. Initially, curses software echo mode is enabled and hardware echo mode of the tty driver is disabled. The echo() and noecho() functions control soft- ware echo only. Hardware echo must remain disabled for the duration of the application, else the behavior is undefined. RETURN VALUES
Upon successful completion, these functions return OK. Otherwise, they return ERR. ERRORS
No errors are defined. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
getch(3XCURSES), getstr(3XCURSES), initscr(3XCURSES), libcurses(3XCURSES), scanw(3XCURSES), attributes(5), standards(5) SunOS 5.11 5 Jun 2002 echo(3XCURSES)
All times are GMT -4. The time now is 10:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy