LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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
Member
 
Registered: Jun 2013
Posts: 32

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: Fedora
Posts: 4,126

Rep: Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260Reputation: 1260
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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:18 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
Open Source Consulting | Domain Registration