Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

puts(3) [mojave man page]

FPUTS(3)						   BSD Library Functions Manual 						  FPUTS(3)

NAME
fputs, puts -- output a line to a stream LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <stdio.h> int fputs(const char *restrict s, FILE *restrict stream); int puts(const char *s); DESCRIPTION
The function fputs() writes the string pointed to by s to the stream pointed to by stream. The function puts() writes the string s, and a terminating newline character, to the stream stdout. RETURN VALUES
The functions fputs() and puts() return a nonnegative integer on success and EOF on error. ERRORS
[EBADF] The stream argument is not a writable stream. The functions fputs() and puts() may also fail and set errno for any of the errors specified for the routines write(2). COMPATIBILITY
fputs() now returns a non-negative number (as opposed to 0) on successful completion. As a result, many tests (e.g., "fputs() == 0", "fputs() != 0") do not give the desired result. Use "fputs() != EOF" or "fputs() == EOF" to determine success or failure. SEE ALSO
ferror(3), fputws(3), putc(3), stdio(3) STANDARDS
The functions fputs() and puts() conform to ISO/IEC 9899:1990 (``ISO C90''). While not mentioned in the standard, both fputs() and puts() print '(null)' if str is NULL. BSD
June 4, 1993 BSD

Check Out this Related Man Page

FPUTS(3)						   BSD Library Functions Manual 						  FPUTS(3)

NAME
fputs, puts -- output a line to a stream LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <stdio.h> int fputs(const char *restrict s, FILE *restrict stream); int puts(const char *s); DESCRIPTION
The function fputs() writes the string pointed to by s to the stream pointed to by stream. The function puts() writes the string s, and a terminating newline character, to the stream stdout. RETURN VALUES
The fputs() function returns 0 on success and EOF on error; puts() returns a nonnegative integer on success and EOF on error. ERRORS
[EBADF] The stream argument is not a writable stream. The functions fputs() and puts() may also fail and set errno for any of the errors specified for the routines write(2). COMPATIBILITY
fputs() now returns a non-negative number (as opposed to 0) on successful completion. As a result, many tests (e.g., "fputs() == 0", "fputs() != 0") do not give the desired result. Use "fputs() != EOF" or "fputs() == EOF" to determine success or failure. SEE ALSO
ferror(3), fputws(3), putc(3), stdio(3) STANDARDS
The functions fputs() and puts() conform to ISO/IEC 9899:1990 (``ISO C90''). While not mentioned in the standard, both fputs() and puts() print '(null)' if str is NULL. BSD
June 4, 1993 BSD
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Checking the format of inputs in a file

Hi, I have a script that takes the contents of another file as inputs. Its assumed that there are 3 values in the input file that are seperated by '|'. I have to check in my script, whether the filed seperator used in the input file is '|' or not. If its not a '|' I have to print a error... (13 Replies)
Discussion started by: sendhilmani123
13 Replies

2. Shell Programming and Scripting

read n number of inputs

Hello, I think its a sinple query but somehow i m stucked up here... I am trying to enter n number of inputs from the user and write them in an input file ie row wise... I tried standard commands like $echo "enter the inputs for the file" $read var1 var2 var3 var4 test1 test2... (14 Replies)
Discussion started by: er_aparna
14 Replies

3. Shell Programming and Scripting

Please give your inputs !!!!

I am trying to extract two fields from the output of ifconfig command on one of my sun server . The output looks like : root@e08k18:/tmp/test# ifconfig -a lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 ce0:... (9 Replies)
Discussion started by: kpatel786
9 Replies

4. Shell Programming and Scripting

limiting data inputs for the user

if my user has to enter the name of months to carry out a search how can I limit the input values to only the month names and nothing else? so far my input criteria for the user is this: i would like it so the user can only enter the months in the way i have stated. otherwise they would... (11 Replies)
Discussion started by: amatuer_lee_3
11 Replies

5. IP Networking

Automated FTP task

Every day i ftp tar.gz a file from the production server to a back up machine.. This task creates way to much traffic on the network at the end of the day and puts and undo load on the production machine during operation hours. i would like to create a script that would automatically fire off the... (36 Replies)
Discussion started by: LowOrderBit
36 Replies

6. Shell Programming and Scripting

simple join for multiple files and produce 3 outputs

sh script file1 filea fileb filec ................filez. >>output1 & output2 &output3 file1 z10 1873 1920 z_number1_E59 z10 2042 2090 z_number2_E59 Z22 2476 2560 z_number3_E59 Z22 2838 2915 z_number4_E59 z1 1873 1920 z_number1_E60 z1 ... (9 Replies)
Discussion started by: stateperl
9 Replies

7. Shell Programming and Scripting

Perl script for taking inputs from one script and storing them into a document.

Hi. I wanted to create a Perl script which can take the outputs of a Perl script as it's input and temporarily store them in a document. Need help. Thanks.:) (8 Replies)
Discussion started by: xtatic
8 Replies

8. Shell Programming and Scripting

Need a shell script which takes two inputs and copy the files from one directory to other

Hi, I am using solari 10 OS which is having bash shell. I need a shell script which takes user home directory and name of the file or directory as a input and based on that copy the files accordingly to the other directory. example:I hava a machine1 which is having some files in a... (8 Replies)
Discussion started by: muraliinfy04
8 Replies

9. Shell Programming and Scripting

Assign specific Color to the outputs in script

Hi, Im programming an interactive menu that verifies the exports of my oracle DB, and im having some trouble finding a process that outputs for example a green command line when the export terminated successfully. i have something like this cat... (15 Replies)
Discussion started by: blacksteel1988
15 Replies

10. Shell Programming and Scripting

Take 10 user inputs and output to file?

I want a script that will prompt a user to enter 10 numbers and out put them into a file. This what I have so far, but isn't working. I'm guessing it's something easy I'm not seeing. Thanks for any help. #!/usr/bin/ksh echo "Enter 10 numbers" for i in 1 2 3 4 5 6 7 8 9 10 do read .... ... (8 Replies)
Discussion started by: AxlVanDamme
8 Replies

11. Shell Programming and Scripting

Storing user inputs into a file

Hi, Am trying to store the user inputs into a file, but the below code will store only the first line of the values. I need to store all the user input values which may contain one or more lines. Thanks in advance. echo "please enter file names"; read name; echo $name>/tmp/test (11 Replies)
Discussion started by: rogerben
11 Replies

12. Shell Programming and Scripting

[Solved] How to refer more than 9 command line inputs for a scripts in korn shell?

Hi all, I have a script which should take more than 9 command line inputs while running. Likescript.sh a s d f g h j j k l o p i u y t r e w Now in the script if I have to access one of the input which is at position after 9, in this case say 'p' then how can I do that? echo $12 will not work... (15 Replies)
Discussion started by: pat_pramod
15 Replies

13. Shell Programming and Scripting

How to provide auto inputs for a sub-script within a script?

Hi All, I am writing a shell script. #!/bin/bash cat /etc/hosts mkdir -p /var/tmp mount 113.123.35.37:/vol/vol615/syb /var/tmp In above script I am trying to add below predefined script/command (/var/tmp/db_tools) This command in turn ask for user input, which will be always option... (17 Replies)
Discussion started by: madhur.baharani
17 Replies

14. Shell Programming and Scripting

Inputs argument for sh -c

I have doubts with the following command: % find "$1" -name "*.html" -print0 | sort -zn | xargs -r -0 -n 1 sh -c 'echo "Dumping file: $2" >> "$1"; w3m "$2" >> "$1" 2>&1 ' sh "$2" I have doubts in the input arguments value i.e. $0, $1, $2... Step by step: 1.- % find "$1" -name "*.html"... (10 Replies)
Discussion started by: puertas12
10 Replies

15. Shell Programming and Scripting

To print diamond asterisk pattern based on inputs

I have to print the number of stars that increases on each line from the minimum number until it reaches the maximum number, and then decreases until it goes back to the minimum number. After printing out the lines of stars, it should also print the total number of stars printed. I have tried... (13 Replies)
Discussion started by: rohit_shinez
13 Replies