Store Large data in Variable in csh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Store Large data in Variable in csh
# 1  
Old 05-18-2012
Store Large data in Variable in csh

Hi All,

This is my first post!! Smilie

How to store huge data in a single variable in csh.

Right now i can store upto ~700kb of data. I still want to store more data and i dont want to use perl.

Is there any method to store like that...Please let me know..

Thanks
# 2  
Old 05-18-2012
You shouldn't be doing that in any shell. The maximum is system-dependent and sometimes surprisingly small.

There's almost certainly better ways to do what you want than storing huge things in variables. What are you actually trying to do?
# 3  
Old 05-18-2012
Thanks for reply..

I am just storing data from a file to a variable and process each record of that file. But if the file size is huge then it will fail to process the records....So i need to have that variable to store huge data.

If any better ways, let me know..
# 4  
Old 05-18-2012
We need more detail to help. Show a sample of the input you have and the output you want. Also, tell us what system you're using so we know what tools you have available. We'll need to see what you're wanting to do, not just how you want to do it, to help.

If you really do need to keep large things in memory at once, csh -- and shells in general -- are simply the wrong tool for the job. A shell is meant to run and join together processes and streams, not process megabytes of raw data by themselves; they're not meant for that and will handle it badly. You might only get 4 kilobytes in some systems and shells, let alone 700! A different language like perl or awk may serve better.

But I'm not convinced this isn't overkill yet. You may be able to handle the records as a stream instead of keeping them all in one blob.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Extract data from a file and store it in a variable

Hi , I have an file like below , cat input.txt 'Pattern2' => 'blahdalskdahdlahldahdlakhdlahdlkajdlkaadasdadadadadadadasda ajlalnalndklandlaksdlkaddd' 'Pattern2' => 'aohaonalkndlanldandlandklasnldnaldnak' ............ ........ ..... Here is what am trying to do , I want to grep for... (3 Replies)
Discussion started by: scott_cog
3 Replies

2. Shell Programming and Scripting

I can't store value in the variable

!#bin/bash clear var= grep @gmail.com email.txt | wc -l echo $var echo $var exit 0 OUTPUT: 1000 _ _ Where _ represent space (no value or nothing) (4 Replies)
Discussion started by: Muhammad Rehan
4 Replies

3. Shell Programming and Scripting

storing large data in unix array variable

Hi, I have table in sql ..from this table im storing the first coloumn values in shell array variable ... after this passing this variable as an arugument in SQL procedure. But the proc. is running fine only for 1024 values in array ... How to store more than 1024 values in the array... (5 Replies)
Discussion started by: ankitknit
5 Replies

4. Red Hat

Store time stamp for .csh shell users

How do I store the time stamps of each command executed for C shell users? However, I am able to set this for Bash users with this command: export HISTTIMEFORMAT="%F %T " This is how a typical .cshrc look like for a Cshell user: # more .cshrc # necessary to get hostname... (3 Replies)
Discussion started by: hedkandi
3 Replies

5. Shell Programming and Scripting

Not able to store command inside a shell variable, and run the variable

Hi, I am trying to do the following thing var='date' $var Above command substitutes date for and in turn runs the date command and i am getting the todays date value. I am trying to do the same thing as following, but facing some problems, unique_host_pro="sed -e ' /#/d'... (3 Replies)
Discussion started by: gvinayagam
3 Replies

6. Shell Programming and Scripting

Reading a variable in csh

I have a simple script that sets a value and reads the value in csh: set -x set a = 10 echo $a The output of the script does not show the value of a + set a = 10 + echo any help would be great. (4 Replies)
Discussion started by: pt14
4 Replies

7. Shell Programming and Scripting

help with multiline variable in csh

My shell is csh and it is required. I have a file like sample.txt ------------------------ a b c d e f g h i ------------------------ I want set the file to a variable and print it out in the same format. I have tried something like this, but not succed. % cat ~/tmp/sample.txt a b c d... (8 Replies)
Discussion started by: anykao
8 Replies

8. UNIX for Dummies Questions & Answers

address variable content with csh

By using a csh, I want to address a variable content whose name is/matches the content of a given other variable. i.e. set name=´sam´ set ${name}_age=´27´ So, by typing: echo ${name}_age I correctly obtain: sam_age By typing: echo $sam_age or echo ${sam_age} I correctly obtain: 27 ... (1 Reply)
Discussion started by: sobolev
1 Replies

9. Shell Programming and Scripting

How to store Data in a File

I want to read a data from a read command and store it in a file...... Plz send me how I can do that Ex: read val and I want to store this val in a file called temp. (2 Replies)
Discussion started by: krishna_sicsr
2 Replies
Login or Register to Ask a Question