Sponsored Content
Top Forums Shell Programming and Scripting Echo and a command's output on the same line Post 302406665 by pludi on Tuesday 23rd of March 2010 02:02:02 PM
Old 03-23-2010
Or, if you can change away from echo, use printf
Code:
printf 'Operating System: %s\n' $( uname )
printf "Operating System: $( uname )\n"

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to place the output of two different echo statements on one line

Hello there, I wrote a shell script to modify the code for some of our clients in our client database. Before starting the data modification the program performs a few checks. When a check is being performed, it should be shown on the screen of the user running the program, the result of... (5 Replies)
Discussion started by: JoBa
5 Replies

2. Shell Programming and Scripting

Output of both the echo statement in one line

I have script like echo -n FINISHED FEXP: ${TABLE2EXP} echo $STATUS I want the output of both the echo statement in one line How can i do this (3 Replies)
Discussion started by: scorp_rahul23
3 Replies

3. Shell Programming and Scripting

Need a Command To display "echo command value in loop" in single line.

Hi I want to display "echo command value in loop" in single line. My requirement is to show the input file (test_1.txt) like the output file (test_2.txt) given below. Input file :test_1.txt a1|b1|4|5 a1|b1|42|9 a2|b2|32|25 a1|b1|2|5 a3|b3|4|8 a2|b2|14|6 Output file:test_2.txt... (2 Replies)
Discussion started by: sakthifire
2 Replies

4. Shell Programming and Scripting

problem with suppressed output to file using echo and tee command

Hi, When I run the following command in terminal it works. The string TEST is appended to a file silently. echo TEST | tee -a file.txt &>/dev/null However, when I paste this same line to a file, say shell1.sh, and use bourne shell . I run this file in terminal, ./shell1.sh. However I... (1 Reply)
Discussion started by: shahanali
1 Replies

5. Shell Programming and Scripting

echo two command output in the same line

Hi, I try to write script and echo two command at the same line . echo "A" echo "B" How can I pipe above two command at the same line in text file . So, in the output text file , you can see below ??? A B not A B Any sugggestion ??? (4 Replies)
Discussion started by: chuikingman
4 Replies

6. Shell Programming and Scripting

Echo output from command

Hello i am trying to do some calculation from output command for example ls -l if then echo "error" else echo "$" fi its something like this which get strings from output command and try to sum total lines of this string if exceed certain number it display error if not it... (3 Replies)
Discussion started by: mogabr
3 Replies

7. UNIX for Dummies Questions & Answers

New line in Echo command

Hi , This might sound little familar to you guys, but am struck with something. i have an IF conditioned loop which will determine a variable to get used in the later part of the script. if ; then if ; then Var_name="This is first line.This is second line.This is... (11 Replies)
Discussion started by: scott_cog
11 Replies

8. Shell Programming and Scripting

How to echo output of a UNIX command (like ls -l ) using shell script.?

How do i echo the output of a unix command using shell script??? Like: echo /etc/ ls -l (2 Replies)
Discussion started by: sunny2802
2 Replies

9. Shell Programming and Scripting

BASH - Need to echo for loop output to one line

I'm trying to echo the release version of some of our Linux servers. Typically I do these types of things by "catting" a text file with the host names, "ssh-ing" to the host and running my string. This is what I've written for i in `cat versions.txt` ; do echo $i ; ssh $i cat /etc/issue |... (5 Replies)
Discussion started by: lombardi4851
5 Replies

10. Shell Programming and Scripting

Grep echo awk print all output on one line

Hello, I've been trying to find the answer to this with Google and trying to browse the forums, but I haven't been able to come up with anything. If this has already been answered, please link me to the thread as I can't find it. I've been asked to write a script that pulls a list of our CPE... (51 Replies)
Discussion started by: rwalker
51 Replies
uname(2)							System Calls Manual							  uname(2)

NAME
uname - Gets the name of the current system SYNOPSIS
#include <sys/utsname.h> int uname( struct utsname *name); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: uname(): XSH5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Points to a utsname structure. DESCRIPTION
The uname() function stores information identifying the current system in the structure pointed to by the name parameter. The uname() function uses the utsname structure, which is defined in the sys/utsname.h file and contains the following members: char sys- name[_SYS_NMLN]; char nodename[_SYS_NMLN]; char release[_SYS_NMLN]; char version[_SYS_NMLN]; char machine[_SYS_NMLN]; The uname() function returns a null-terminated character string naming the current system in the sysname character array. The nodename array contains the name that the system is known by on a communications network. The release and version arrays further identify the sys- tem. The machine array identifies the CPU hardware being used. RETURN VALUES
Upon successful completion, a nonnegative value is returned. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS
If the uname() function fails, errno may be set to the following value: [Tru64 UNIX] The name parameter points outside of the process address space. RELATED INFORMATION
Commands: uname(1) Standards: standards(5) delim off uname(2)
All times are GMT -4. The time now is 06:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy