LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-18-2014, 12:42 PM   #1
hoi
LQ Newbie
 
Registered: Jun 2013
Posts: 29

Rep: Reputation: Disabled
xargs output with more space


[input]
1
2
3
4

cat input | xargs
1 2 3 4

but I want output with more space between the numbers. Like..
1 2 3 4

How to do?
 
Old 04-19-2014, 07:51 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,754

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Code:
echo $input
1 2 3 4
for i in $input ; do echo -n "   "$i ; done ; echo ""
   1   2   3   4
 
  


Reply

Tags
bash script $@, bash scripting, shell script, shell scripting


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
xargs: unmatched single quote; by default quotes are special to xargs unless you use Raakh5 Linux - Newbie 7 05-21-2014 07:26 PM
find . -mtime +1 | xargs ls -ltr, giving different output on same OS hamijami Linux - General 1 09-25-2013 10:42 AM
[SOLVED] Xargs with output of find thund3rstruck Programming 6 07-17-2011 08:26 AM
grep | xargs -I echo $(foo; bar; echo $(fee; fi; fo; fum)) == questionable output.. GrapefruiTgirl Programming 11 12-07-2010 07:02 PM
When I use xargs with echo, why does the output contain an extra space? web_janitor Linux - General 2 08-20-2009 04:18 PM


All times are GMT -5. The time now is 07:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration