Sponsored Content
Top Forums Shell Programming and Scripting How can I write variables to same line of a file? Post 302930782 by xbin on Wednesday 7th of January 2015 10:31:42 AM
Old 01-07-2015
Code:
echo -n "${var1}," >> log_file
.
.
echo -n "${var2}," >> log_file
.
.

or

printf "${var1}," >> log_file
.
.
printf "${var2}," >> log_file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Write system variables into file

Hi everyone, I was told, i my job, to do a script that creates the backup of all the files that are important to us. So i created the script, put it in the crontab and it works great. Now what i want is to write to a file what directories have being copied with date and time. How can i... (3 Replies)
Discussion started by: jorge.ferreira
3 Replies

2. Shell Programming and Scripting

Re-write first line of a file before printing

Morning All, Quite a simple one this, I hope. What I want to do is to re-write the first line of a file before it's sent to print. The line will be blank initially, and I want to insert some text. The operation can either be done on the file itself (modifying the file on disk), OR in a... (2 Replies)
Discussion started by: alexop
2 Replies

3. UNIX for Dummies Questions & Answers

write new line at the beginning of an existing file

I was trying to find out the easiest way to write new line to the beginning of an exisiting file. I am using KSH. (5 Replies)
Discussion started by: sailussr
5 Replies

4. Shell Programming and Scripting

Write in a file with pipe also in same line

hi, i want to write in a file the output of one command and pile also the same output like ls -lrt > some_file | wc -l (9 Replies)
Discussion started by: narang.mohit
9 Replies

5. Shell Programming and Scripting

Lookup two values per line (from a second file) and write the smaller value to another file

Hello Unix Gurus, Please let me know if this is hard to understand and I apologize for my inability to explain better. I have a file "Foo" with the following structure CHR_A BP_A SNP_A CHR_B BP_B SNP_B R2 1 ... (3 Replies)
Discussion started by: genehunter
3 Replies

6. Programming

How to write a new line to the end of the file in Perl?

i am very new to Perl. i am using Ubuntu. i have a string call $string that contains following words "new line". i also have a data file as follows. djfibjbet etitrbjijbtr rrge rgjierjegjeri jerijg kijij jijij i want to write my new line to my data file as follows. djfibjbet... (3 Replies)
Discussion started by: usustarr
3 Replies

7. Shell Programming and Scripting

Write string variables to file

I have the following: #! /bin/bash foo="bar" this="that" vars="foovar=$foo\n\ thisvar=$this\n" I want to write the following to a file: foovar="bar" thisvar="that" Then in another script, I pull this file, and loop through it: while read line; do eval $line done <... (3 Replies)
Discussion started by: Validatorian
3 Replies

8. Shell Programming and Scripting

how read specific line in a file and write it in a new text file?

I have list of files in a directory 'dir'. Each file is of type HTML. I need to read each file and get the string which starts with 'http' and write them in a new text file. How can i do this shell scripting? file1.html <head> <url>http://www.google.com</url> </head> file2.html <head>... (6 Replies)
Discussion started by: vel4ever
6 Replies

9. Shell Programming and Scripting

write specific line number in file

dear all, i need your advice i have sample script like this: testing.sh for i in {1..10} do echo testing $i done but i forgot create "#!/bin/bash" in above "for" so i want output will like this testing.sh #!/bin/bash for i in {1..10} do echo testing $i done (2 Replies)
Discussion started by: zvtral
2 Replies

10. Shell Programming and Scripting

Search pattern and write line into another file

Hi, I have a file which contains the below details.. My requirement is to fetch all the lines which are starting with "ABC_XY_" into 1 file and rest of the lines (not starting with "ABC_XY_") into another file. Could you please help with what command needs to be used? file1.txt ----------... (12 Replies)
Discussion started by: satyaatcgi
12 Replies
rstatd(1M)																rstatd(1M)

NAME
rstatd - kernel statistics server SYNOPSIS
log_file] DESCRIPTION
is an RPC server that returns performance statistics obtained from the kernel. The utility prints this information (see rup(1)). invokes through (see inetd(1M)). Options recognizes the following options and command-line arguments: Log any errors to the named log file, log_file. Errors are not logged if the option is not specified. Information logged to the file includes date and time of the error, the host name, process ID and name of the func- tion generating the error, and the error message. Note that different services can share a single log file because enough information is included to uniquely identify each error. Exit after serving each RPC request. Using the option, the security file can control access to RPC services. Exit only if o dies (see portmap(1M)), o another registers with or o becomes unregistered with portmap. The option is more efficient since a new process is not launched for each RPC request. Note, this option is the default. AUTHOR
was developed by Sun Microsystems, Inc. SEE ALSO
rup(1), inetd(1M), portmap(1M), inetd.conf(4), inetd.sec(4), services(4). rstatd(1M)
All times are GMT -4. The time now is 04:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy