List creation - Grep a line in a file with a script name


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting List creation - Grep a line in a file with a script name
# 8  
Old 05-22-2014
Quote:
Originally Posted by member2014
test2.ksh and test3.ksh read the .lst file and execute the scripts in the list. They are just like wrappers. The result list here needs to be just the actual scripts that execute.
The List1 is the main script which executes all scripts under it. When the execution comes to the line test3.ksh test3.lst, it call test3.ksh with test3.lst as the parameter. All that the script does is it executes the list of scripts under the test3.lst.
So when I create the master list I dont need the entry test3.ksh test3.lst and instead I need the scripts list inside the test3.lst.

For this I am looping through the List1, when the script finds a line with .lst, it replaces that line with the contents (script list) of the .lst file. Does this make sense?
Yes, it makes sense. And the script I gave you does exactly that.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Need UNIX script to check checksum and dummy file creation.

Hi Folks, I need a UNIX script which will copy files(Table wise) from source directory to destination directory (Under table directory) and also creates 2 additional files after getting copied to destination directory with extension .pdy and .ldy , . pdy file will be zero byte file should get... (4 Replies)
Discussion started by: Nicks1412
4 Replies

2. Shell Programming and Scripting

Script to print file name and its creation date

Hello , I am looking for a script to print file name and its last updated time. FILE CREATION-TIME FILE-NAME 24/10/2017 12:34 TDR-IU-8-2017.10.24.07:40:00-2017.10.24.07:45:00 when we run l command it print the directory and the files with details like permission,... (1 Reply)
Discussion started by: sadique.manzar
1 Replies

3. Shell Programming and Scripting

CSV File Creation Within Shell Script

Hi All, I am trying to create a CSV file within a shell script test.ksh and the code snippet is something like below: #!/usr/bin/ksh # Set required variables. . $HOME/.prof # Output file path Group1=/tmp/G1.csv Group2=/tmp/G2.csv Group3=/tmp/G3.csv $ORACLE_HOME/bin/sqlplus -s... (2 Replies)
Discussion started by: swasid
2 Replies

4. Shell Programming and Scripting

File system creation script on AIX 6.1 using while loop

#!/bin/sh echo "VG: " read VG echo "LP: " read LP echo "SAP: " read SAP echo "NUM: " read NUM echo "SID: " read SID while ]; read VG LP SAP NUM SID ; do mklv -y $SAP$NUM -t jfs2 -e x $VG $LP; crfs -v jfs2 -d /dev/$SAP$NUM -m /oracle/$SID/$SAP$NUM ... (14 Replies)
Discussion started by: arorap
14 Replies

5. Shell Programming and Scripting

Grep by range of date from file creation in directory

Hi Expert, Need your scripting and finding data so that it help me to find the culprit of this memory usage error. Data provided here is a sample. Process Snapshot directory: /var/spool/processes-snapshot webdev9o9% pwd /var/spool/processes-snapshot webdev9o9% ls -lrct -rw-r--r-- ... (3 Replies)
Discussion started by: regmaster
3 Replies

6. Shell Programming and Scripting

Avoid file creation in a script...achive same result

Guys following lines help me in getting numbers from PID column ,to be thrown into first column of a CSV file. COLUMNS=2047 /usr/bin/ps -eo pid,ppid,uid,user,args | grep -v "PID" > /tmp/masterPID.txt cat /tmp/masterPID.txt|while read line do PID=`echo $line|awk '{print $1}'` echo "$PID"... (4 Replies)
Discussion started by: ak835
4 Replies

7. Shell Programming and Scripting

how to grep a file in list

hi all, for an example: In a file out.txt contains: /export/home/raghu/bin/debug_serverLog_apache_20090626_0625.txt How to grep or cut the value as "debug_serverLog_apache_20090626_0625.txt" or i want only the output as "debug_serverLog_apache_20090626_0625.txt" pls advice me (3 Replies)
Discussion started by: raghur77
3 Replies

8. Shell Programming and Scripting

Creation of script,if the data file have more than one entry!!!

1.Daily there will be 14 files in the data directory 2.someday's the 14 files receive more than once r twice with different time stamps....we need to chk the count of the file and if the count of the file is two.we need to combine the both the files. 3. if any duplicate data is there just... (1 Reply)
Discussion started by: bobprabhu
1 Replies

9. Shell Programming and Scripting

Creation of output file from list of file

Hi Guru's, Eventhough I know basic shell scripting, Iam not an expert. Can any one help me to get a logic/answer for the below requirement: I've to create an output file "outputfile.txt" from many datafiles (ex: abc.dat, xyz.dat). Header record layout for "outputfile.txt" should be... (7 Replies)
Discussion started by: ganapati
7 Replies

10. Shell Programming and Scripting

Creation and Transfer of TAR file from one machine to another Using UNIX script

Hi, I want to create unix script such that it should run on machine A, it should run TAR commands on machine B and copy that TAR to machine C. Is it possible? Thanks Rahul (2 Replies)
Discussion started by: rahuljadhav
2 Replies
Login or Register to Ask a Question
script(1)							   User Commands							 script(1)

NAME
script - make record of a terminal session SYNOPSIS
script [-a] [filename] DESCRIPTION
The script utility makes a record of everything printed on your screen. The record is written to filename. If no file name is given, the record is saved in the file typescript. See WARNINGS. The script command forks and creates a sub-shell, according to the value of $SHELL, and records the text from this session. The script ends when the forked shell exits or when Control-d is typed. OPTIONS
The following option is supported: -a Appends the session record to filename, rather than overwriting it. NOTES
script places everything that appears on the screen in filename, including prompts. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5) WARNINGS
script can pose a security risk when used in directories that are writable by other users (for example, /tmp), especially when run by a privileged user, that is, root. Be sure that typescript is not a link before running script. SunOS 5.11 30 Jan 2004 script(1)