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
FPUTS(3) BSD Library Functions Manual FPUTS(3)NAME
fputs, puts -- output a line to a stream
Standard C Library (libc, -lc)
fputs(const char *restrict s, FILE *restrict stream);
puts(const char *s);
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.
The functions fputs() and puts() return a nonnegative integer on success and EOF on error.
[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).
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
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 18.104.22.168:/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)