puts, fputs - put a string on a stream
The subroutine copies the null-terminated string s to the standard output stream stdout and appends a new line character.
The subroutine copies the null-terminated string s to the named output stream.
Neither routine copies the terminal null character.
The subroutine appends a new line, while does not.
See Alsofopen(3s), gets(3s), putc(3s), printf(3s), ferror(3s)fread(3s)puts(3s)
Check Out this Related Man Page
puts(3C) Standard C Library Functions puts(3C)NAME
puts, fputs - put a string on a stream
int puts(const char *s);
int fputs(const char *s, FILE *stream);
The puts() function writes the string pointed to by s, followed by a NEWLINE character, to the standard output stream stdout (see
Intro(3)). The terminating null byte is not written.
The fputs() function writes the null-terminated string pointed to by s to the named output stream. The terminating null byte is not writ-
The st_ctime and st_mtime fields of the file will be marked for update between the successful execution of fputs() and the next successful
completion of a call to fflush(3C) or fclose(3C) on the same stream or a call to exit(2) or abort(3C).
On successful completion, both functions return the number of bytes written; otherwise they return EOF and set errno to indicate the error.
Refer to fputc(3C).
Unlike puts(), the fputs() function does not write a NEWLINE character at the end of the string.
See attributes(5) for descriptions of the following attributes:
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|Interface Stability |Standard |
|MT-Level |MT-Safe |
SEE ALSO exit(2), write(2), Intro(3), abort(3C), fclose(3C), ferror(3C), fflush(3C), fopen(3C), fputc(3C), printf(3C), stdio(3C), attributes(5),
standards(5)SunOS 5.11 18 Jun 2003 puts(3C)
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)
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)
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)
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)
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)
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)
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)
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.
echo "Enter 10 numbers"
for i in 1 2 3 4 5 6 7 8 9 10
read .... ... (8 Replies)
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";
echo $name>/tmp/test (11 Replies)
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)
I am writing a shell script.
mkdir -p /var/tmp
mount 126.96.36.199:/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)
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)
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)