Sponsored Content
Full Discussion: QUESTION...simple program?
Top Forums Programming QUESTION...simple program? Post 14579 by jj1814 on Saturday 2nd of February 2002 07:08:31 PM
Old 02-02-2002
Question QUESTION...simple program?

I am new to the unix/linux environment.
AND........
I need to create a mini shell..that displays prompt (i.e., READY:$), accepts a command from std-in, and prints the command and any parameters passed to it. HELP!!!!
 

10 More Discussions You Might Find Interesting

1. Programming

Simple Network Program Difficulties

I'm trying to write 2 programs, client & server, that communicate with integers, however, all resources I have found on the net assume that you want to send and recieve information as a character array. I don't want to send my integers as characters, I want to send them as ints (casting them to... (2 Replies)
Discussion started by: Mistwolf
2 Replies

2. UNIX for Dummies Questions & Answers

Ok simple question for simple knowledge...

Ok what is BSD exactly? I know its a type of open source but what is it exactly? (1 Reply)
Discussion started by: Corrail
1 Replies

3. Programming

a simple chat program

any suggestions on how i could create a simple chat program between two terminals using pipes? thanks (1 Reply)
Discussion started by: kelogs1347
1 Replies

4. Programming

Xlib simple program.

I don't know if it is right to ask you this. Can someone help me write a simple Xlib program,with button on it,and all that button do is switch 2 messages. I have tried and tried,but never get past Hello World. Can someone help me please? ---------- Post updated at 10:17 PM ---------- Previous... (2 Replies)
Discussion started by: megane16v
2 Replies

5. UNIX for Dummies Questions & Answers

What's wrong with this simple program in APUE?

I start wetting my toes in Linux programming. I tried the first program myls.c in Advanced Programming in the Unix Environment. #include <sys/types.h> #include <dirent.h> #include "apue.h" int main(int argc, char *argv) { DIR *dp; struct... (1 Reply)
Discussion started by: cqlouis
1 Replies

6. Shell Programming and Scripting

simple program help required

The circumfrence of a circle is #!/usr/bin/perl print 2 * 3.141592654 * 12.50 \n"; # pi= 3.141592654 # r= 12.50 I need a simple program showing me all the steps..to modify the above to prompt for and accept a radius from the person running the... (3 Replies)
Discussion started by: Q2wert
3 Replies

7. Shell Programming and Scripting

Help with simple program. (beginner)

Hey all, Writing a program that searches for a username and if they are online creates a 'beep' and sends the username and date to a log file. the error i am getting is: paul.obrien16@aisling:~/os$ bash checklogin : command not found Enter username paul.obrien16 ': not a valid... (2 Replies)
Discussion started by: sexyladywall
2 Replies

8. UNIX for Dummies Questions & Answers

Help with creating a simple program!!

i am new to shell scripting!! i am making this program in bourne shell, that asks the user to input "Hello (their name)" or "question (their name)", any other input, "ERROR" will be outputted. if they input "Hello (name)", i want to out saying Hello (name) but if they input "question (name)", i... (4 Replies)
Discussion started by: bshell_1214
4 Replies

9. Programming

A simple C program query ...

Given the following code inside the function ext3_write_super(): (It's there in Linux kernel 2.6.27.59) static void ext3_write_super (struct super_block * sb) { if (mutex_trylock(&sb->s_lock) != 0) BUG(); sb->s_dirt = 0; } The conditional test at if... (2 Replies)
Discussion started by: Praveen_218
2 Replies

10. Red Hat

Syslog.conf: looking for a simple answer on a simple question

Cheers! In /etc/syslog.conf, if an error type is not specified, is it logged anywhere (most preferable is it logged to /var/log/messages) or not? To be more precise I am interested in error and critical level messages. At default these errors are not specified in syslog.conf, and I need to... (6 Replies)
Discussion started by: dr1zzt3r
6 Replies
PG(1)								   User Commands							     PG(1)

NAME
pg - browse pagewise through text files SYNOPSIS
pg [-number] [-p string] [-cefnrs] [+line] [+/pattern/] [file...] DESCRIPTION
pg displays a text file on a CRT one screenful at once. After each page, a prompt is displayed. The user may then either press the new- line key to view the next page or one of the keys described below. If no filename is given on the command line, pg reads from standard input. If standard output is not a terminal, pg acts like cat(1) but precedes each file with its name if there is more than one. If input comes from a pipe, pg stores the data in a buffer file while reading to make navigation possible. OPTIONS
pg accepts the following options: -number The number of lines per page. Usually, this is the number of CRT lines minus one. -c Clear the screen before a page is displayed, if the terminfo entry for the terminal provides this capability. -e Do not pause and display (EOF) at the end of a file. -f Do not split long lines. -n Without this option, commands must be terminated by a newline character. With this option, pg advances once a command letter is entered. -p string Instead of the normal prompt :, string is displayed. If string contains %d, its first occurrence is replaced by the number of the current page. -r Disallow the shell escape. -s Print messages in standout mode, if the terminfo entry for the terminal provides this capability. +number Start at the given line. +/pattern/ Start at the line containing the Basic Regular Expression pattern given. USAGE
The following commands may be entered at the prompt. Commands preceded by i in this document accept a number as argument, positive or neg- ative. If this argument starts with + or -, it is interpreted relative to the current position in the input file, otherwise relative to the beginning. i<newline> Display the next or the indicated page. id or ^D Display the next halfpage. If i is given, it is always interpreted relative to the current position. il Display the next or the indicated line. if Skip a page forward. i must be a positive number and is always interpreted relative to the current position. iw or iz Behave as <newline> except that i becomes the new page size. . or ^L Redraw the screen. $ Advance to the last line of the input file. i/pattern/ Search forward until the first or the i-th occurrence of the Basic Regular Expression pattern is found. The search starts after the current page and stops at the end of the file. No wrap-around is performed. i must be a positive number. i?pattern? or i^pattern^ Search backward until the first or the i-th occurrence of the Basic Regular Expression pattern is found. The search starts before the current page and stops at the beginning of the file. No wrap-around is performed. i must be a positive number. The search commands accept an added letter. If t is given, the line containing the pattern is displayed at the top of the screen, which is the default. m selects the middle and b the bottom of the screen. The selected position is used in following searches, too. in Advance to the next file or i files forward. ip Reread the previous file or i files backward. s filename Save the current file to the given filename. h Display a command summary. !command Execute command using the shell. q or Q Quit. If the user presses the interrupt or quit key while pg reads from the input file or writes on the terminal, pg will immediately display the prompt. In all other situations these keys will terminate pg. ENVIRONMENT VARIABLES
The following environment variables affect the behaviour of pg: COLUMNS Overrides the system-supplied number of columns if set. LANG, LC_ALL, LC_COLLATE, LC_CTYPE, LC_MESSAGES See locale(7). LINES Overrides the system-supplied number of lines if set. SHELL Used by the ! command. TERM Determines the terminal type. SEE ALSO
cat(1), more(1), sh(1), terminfo(5), locale(7), regex(7), term(7) NOTES
pg expects the terminal tabulators to be set every eight positions. Files that include NUL characters cannot be displayed by pg. AVAILABILITY
The pg command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/. util-linux April 2001 PG(1)
All times are GMT -4. The time now is 07:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy