LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 12-12-2014, 08:08 AM   #1
shazo
LQ Newbie
 
Registered: Dec 2014
Posts: 12

Rep: Reputation: Disabled
how i can genrate LUTs using bash


hello,
i have to make a table of form {1,2,3,4}
{1,2,4,5}
{1,2,3,4}
i have data in difernt files how i will genrate this using bash. your coments will be apriciated.
 
Old 12-12-2014, 10:47 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 8,527

Rep: Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439
you need to give us more detailed information about the files containing the input data and how do you want to construct the result.
 
Old 12-12-2014, 11:01 AM   #3
shazo
LQ Newbie
 
Registered: Dec 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
i have a files having data which is random data like some have data(numbers) in vertical and in some files data(numbers)is in horitontal. these files are atomatically genrated file i have to access it to take data only i dont have to rearange them. my task is "i have to access files to take the data from all files ,lets say 2 files and arange them as a table form like 10 numbers in one line other 10 in next line and so on upto let us say 5 lines.
 
Old 12-12-2014, 11:04 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 8,527

Rep: Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439Reputation: 2439
can you show an example? How should it really work? By the way, have you tried to implement it?
 
Old 12-12-2014, 11:21 AM   #5
shazo
LQ Newbie
 
Registered: Dec 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
yeah i am tring using single file but i am not getting what i want
here is
#!/bin/bash

for (( i = 1; i <= 14; i++ ))
do

for (( j = 1 ; j <= 11; j++ ))
do
#while
read -r name
#do
echo "{$name,}"

done <"$Files"

echo ""
done


done

Last edited by shazo; 12-12-2014 at 06:23 PM.
 
Old 12-12-2014, 12:13 PM   #6
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,425

Rep: Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826Reputation: 2826
Firstly, please use [code][/code] tags around your code.

As for the code itself, it makes little to no sense

1. You have commented out the start of the while loop, but left in the 'done' that is trying to read from the file

2. You read a value into 'name' variable and echo it straight away ... for what reason?

3. What purpose do the 2 for loops hold? Ignoring the 'done' trying to read from a file, these loops will ask for and print the 'name' variable 154 times ... is this the idea?

4. Lastly, what is a 'LUT'? (pardon my ignorance)
 
  


Reply


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
[To share Bash knowledge]Notes for Advanced Bash-Scripting Version 10 (Latest) jcky Programming 4 07-31-2014 10:24 AM
[SOLVED] Converting Script from Linux (GNU) Bash 4 to Solaris Bash 2.05 - Any cheat sheet? oly_r Solaris / OpenSolaris 6 05-03-2013 09:25 AM
Bash problem : -bash: [: /bin/bash: unary operator expected J.A.X Linux - Software 1 09-22-2011 06:52 AM
GCC 2.2.2 seems to genrate bad code dogbird Programming 2 11-19-2005 01:55 PM
why did bash 2.05b install delete /bin/bash & "/bin/sh -> bash"? johnpipe Linux - Software 2 06-06-2004 07:42 PM


All times are GMT -5. The time now is 06:53 PM.

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