Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

puts(3s) [v7 man page]

PUTS(3S)																  PUTS(3S)

puts, fputs - put a string on a stream SYNOPSIS
#include <stdio.h> puts(s) char *s; fputs(s, stream) char *s; FILE *stream; DESCRIPTION
Puts copies the null-terminated string s to the standard output stream stdout and appends a newline character. Fputs copies the null-terminated string s to the named output stream. Neither routine copies the terminal null character. SEE ALSO
fopen(3), gets(3), putc(3), printf(3), ferror(3) fread(3) for fwrite BUGS
Puts appends a newline, fputs does not, all in the name of backward compatibility. PUTS(3S)

Check Out this Related Man Page

PUTS(3) 						     Linux Programmer's Manual							   PUTS(3)

fputc, fputs, putc, putchar, puts - output of characters and strings SYNOPSIS
#include <stdio.h> int fputc(int c, FILE *stream); int fputs(const char *s, FILE *stream); int putc(int c, FILE *stream); int putchar(int c); int puts(const char *s); DESCRIPTION
fputc() writes the character c, cast to an unsigned char, to stream. fputs() writes the string s to stream, without its trailing ''. putc() is equivalent to fputc() except that it may be implemented as a macro which evaluates stream more than once. putchar(c); is equivalent to putc(c,stdout). puts() writes the string s and a trailing newline to stdout. Calls to the functions described here can be mixed with each other and with calls to other output functions from the stdio library for the same output stream. For non-locking counterparts, see unlocked_stdio(3). RETURN VALUE
fputc(), putc() and putchar() return the character written as an unsigned char cast to an int or EOF on error. puts() and fputs() return a non-negative number on success, or EOF on error. CONFORMING TO
It is not advisable to mix calls to output functions from the stdio library with low - level calls to write() for the file descriptor asso- ciated with the same output stream; the results will be undefined and very probably not what you want. SEE ALSO
write(2), ferror(3), fopen(3), fseek(3), fwrite(3), gets(3), scanf(3), unlocked_stdio(3) GNU
1993-04-04 PUTS(3)
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 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. 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 /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