![]() |
|
|
|
|
|||||||
| 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 |
| Executing scripts in Parallel | itsme_maverick | Shell Programming and Scripting | 2 | 06-06-2008 08:23 AM |
| Reading 5 Students names and grades using while loop???? | dlbomber1 | Shell Programming and Scripting | 1 | 11-25-2007 11:46 PM |
| Reading file names from a file and executing the relative file from shell script | anushilrai | Shell Programming and Scripting | 4 | 03-10-2006 02:25 AM |
| Executing Shell Scripts | BuyoCat | UNIX for Dummies Questions & Answers | 1 | 09-06-2005 10:11 PM |
| executing variables in ksh scripts? | zedmelon | Shell Programming and Scripting | 3 | 08-06-2003 10:50 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
file.txt contains
------------------ sat1 1300 sat2 2400 sat3 sat4 500 I need to write a shell script that will output like the below #output sat1.ksh 1300 sat2.ksh 2400 sat3.ksh sat4.ksh 500 my try ------- #!/bin/ksh for i in `cat file.txt` do SCR_NAME=`echo $i| awk '{print $1}'` PARAM=`echo $i| awk '{print $2}'` echo "${SCR_NAME}.ksh ${PARAM}" # want to call a function here in future done can someone please advise?? ~ Last edited by konark; 11-07-2007 at 05:23 PM. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Any suggestion for the above query '??
Last edited by konark; 11-07-2007 at 05:25 PM. |
|
#3
|
|||
|
|||
|
FILE=file.txt
for i in `cat $FILE` do SCR_NAME=`awk '{print $1}' $i` PARAM=`awk '{print $2}' $i` echo "${SCR_NAME}.ksh ${PARAM}" done I m trying to do something like this. It doesnt work .Can you please help ~ ~ ~ |
|
#4
|
|||
|
|||
|
Code:
awk '{$1=$1".ksh"}1' file
|
|||
| Google The UNIX and Linux Forums |