I like your approach the best. The script automatically files input files and consumes as it finishes. The only change I would make is building LOAD into the script so it's not dependent on an environment variable.
You can also do something like:
A "for" loop like this is looping over the arguments to the script. You invoke this from yor favorite interactive shell that has filename completion capabilities.
But you don't want scripts to have their own custom filename completion code. After you have 100 scripts, each a little different, it's a nightmare. And if you go on vacation your assistant has a steep learning curve with even one such script. But if you use ksh and he uses tcsh, you both can use the command completion system that you know with the simpler approach.
At my company, we build some stuff using a makefile. While the makefile script is running, a developer may check in a newer version of a source file. The problem is, when we next run the make command, the target file isn't rebuilt, because the date of the target is after the dependency.
Any... (1 Reply)
I have lines like:
Mg2.qns W=0.175u
Mg2.qpsb W=0.175u
Mg4.qns W=0.175u
Mg4.qpsb W=0.175u
Which I need to become:
Mg2.qns W=wmg2qns
Mg2.qpsb W=wmg2qpsb
Mg4.qns W=wmg4qns
Mg4.qpsb W=wmg4qpsb
To acheive this individually line by line I use a command like:... (3 Replies)
I have a string as "Period= 20090531 Client Name= Clayton Lumbar Company Destination= MD"
I want to parse the string and store it in 3 different variables.
$period (should get value 20090531)
$client (should get value "Clayton Lumbar company")
$dest (should get value MD)
How can I do... (3 Replies)
Q. Write a script that behaves both in interactive and non interactive mode. When no arguments are supplied it picks up each C program from the directory and prints first 10 lines.
It then prompts for deletion of the file.
If user supplies arguments with the script , then it works on those files... (1 Reply)
Q. Write a script that behaves both in interactive and non interactive mode. When no arguments are supplied it picks up each C program from the directory and prints first 10 lines.
It then prompts for deletion of the file.
If user supplies arguments with the script , then it works on those files... (8 Replies)
hello everyone!:)
I have an exercise which I think is difficult for beginner like me. Here is the exercise
Create a shell script, which takes a directory as command line argument.
Script displays ten first lines from every text file in that directory. After
displaying the lines from the... (1 Reply)