![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| help me in sending parameters from sqlplus script to unix shell script | Hara | Shell Programming and Scripting | 2 | 01-29-2008 12:31 PM |
| Shell Script: want to insert values in database when update script runs | ring | Shell Programming and Scripting | 1 | 10-25-2007 12:06 AM |
| here document to automate perl script that call script | hogger84 | Shell Programming and Scripting | 3 | 10-22-2007 07:15 AM |
| returning to the parent shell after invoking a script within a script | gurukottur | Shell Programming and Scripting | 5 | 09-26-2006 04:05 AM |
| return valuse from child script to parent script | borncrazy | Shell Programming and Scripting | 1 | 08-20-2004 12:39 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Script help
I have two files namely names and others markets.
The entry in names file Quote:
and the entries in markets is like Quote:
like Quote:
I just gave the example above and there are lot of entries in names and markets files. That is why i need a program. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
This solution might not be efficient for a large "names.out" or "market.out" :-)
Code:
$ cat names.out
n1
n2
$ cat market.out
m1
m2
$ cat fnam.sh
#!/bin/sh
for ns in `cat names.out`
do
for ms in `cat market.out`
do
echo "Creating $ns.$ms.$1"
touch "$ns.$ms.$1"
done
done
$ ./fnam.sh 01232008.batch1.dat
Creating n1.m1.01232008.batch1.dat
Creating n1.m2.01232008.batch1.dat
Creating n2.m1.01232008.batch1.dat
Creating n2.m2.01232008.batch1.dat
|
||||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|