![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Telnet in batch file | aemunathan | UNIX for Dummies Questions & Answers | 1 | 05-09-2008 07:38 AM |
| rename the file in batch | reldb | UNIX for Advanced & Expert Users | 7 | 01-14-2008 02:43 PM |
| batch file | ramneek | High Level Programming | 3 | 11-09-2005 01:48 AM |
| batch file | ramneek | IP Networking | 1 | 11-08-2005 07:09 AM |
| Creating a batch file. | spotanddot | UNIX for Dummies Questions & Answers | 2 | 06-26-2001 01:45 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
I have a data file with 4 columns of numbers with a space delimiters.
I have a script that I can run from the command line that will insert parameters directly on the command line. For example: script.ksh 100 200 300 400 What I am trying to do is do a mass update using a big data file, and I don't want to type in these thousands of numbers line by line. I'm sure there is a way of doing this, but I wouldn't even know what to search on to see if it's been done before. Can anybody help please. Thanks |
| Forum Sponsor | ||
|
|
|
|||
|
Hmm might work, but I've forgot to say one thing..
The shell script that I can run from the command line, has $VAR1 $VAR2 $VAR3 $VAR4 inside the script. So when I run it from the unix prompt I can put in script.ksh 1 2 3 4 for example. So that $VAR1=1 and so on. Will the example do the same ? |
|
|||
|
It should work.. But, copy all your files to a temporary location and test thoroughly...
I might point out that the reason I called it "sloppy" is because it does not sanity checking on the data.. For example, it does not make sure that everything is "numeric", nor does it verify that there are 4 fields on each line of you "big data file".... A truly better solution would be to design your "script.ksh" to accept 2 forms on input, one from the command line and the other from STDIN... The reason for this is everytime that "script.ksh" is run it must fork off a new process, which takes time... If the number of files to be updated are extremely large (say 1000 or more?) it will be a noticable difference.... If you wish to post your script.ksh here I will be delighted to offer a more comprehensive analysis for you... - dEvNuL |