First I apologize for my ignorance as I am very new to the world of UNIX but love it and have a huge desire to learn it.
A question I have is if a Korn script utilizes/relies on an argument to run, can you add these into a file and pipe them to the script without changing anything inside the Korn script?
Example:
Currently I run
(the script fetches the dns zone to resource records for the domain djzah.com)
I want to run the ksh script on multiple domains. So say I create a file called domains.txt with the following:
Now can I run the korn script telling it to pull argument line by line like
OR do you have to add a while loop in the script and if so is it safe to just assume you add at the beginning something like:
Thanks for any suggestions..... I could be insane, it hasn't been proven yet.
Last edited by Don Cragun; 01-08-2014 at 03:00 PM..
Reason: Add CODE tags.
Have you tried invoking the script with more than one operand? For example:
If that gives you the results you want for those two domains, then for the list of domains in your file, try:
If that didn't work, try:
That is getting me closer. The first suggestion didn't work for me but the last suggestion did with one minor change.
I can definitely make this work
I'm curious if I could make it work inside the file since $1 is the domain
Example: ./fetch.ksh djzah.com
$1 = djzah.com
in the fetch.ksh script the input check is
Could I incorporate the code you provided in the fetch script so I could utilize
./fetch.ksh domainsph1.txt
./fetch.ksh domainsph2.txt
Of course the domains listed inside each .txt file taking place of the $1 variable.
To make this happen, could I just edit fetch.ksh and add
at the beginning of the script
at the end of the script
HI
I need to get the function "kick" to get executed in any way the parameters are passed in to the function. The parameters are first stored in a dictionary
self.otherlist = {}
print self.otherlist
self.populateTestList(self.system_type)
print... (1 Reply)
Hi guys,
I have created a csh script which allows user to pass input argument with the script like:
cluster_on_lev3.csh -t <value> -p <value>
Example:
cluster_on_lev3.csh -t 2.3 -p 0.05
Now I want to create an error code where if user passes input argument without spaces , the code... (16 Replies)
Hi,
This is most likely a dumb question but I could not find answer to it elsewhere.
I'm building a simple menu with case /esac and want to read user's input:
Please enter XYZ ; read XYZ
How do I take the value of XYZ and insert it as a variable $XYZ in file file.txt ?
I may need to... (9 Replies)
Hello,
Is there any method thorugh which script can take argument if pass otherwise if argument doesn't pass then it takes the argument from the configuration file
i.e I am workiing on a script which will run through crontab and the script will
chekout the code ,zip and copy to the... (3 Replies)
I know this is a simple matter, but I'm new to this.
I have a shell script that calls a sed script from within it. I want the output of the shell script to be based on the input file I pass as an argument to the original script. In other words...
./script.sh file.txt
(script.sh calls sed... (2 Replies)
as the title, how can i allow a user to key in one's name, birthday and email address and save it into a specific file i have created earlier?
thank you so much for any reply. (3 Replies)
Dear all,
i am not getting the exact things what i am expecting from
these commands . just clarify this things ,
1. cpu utilization (min)%
2.peak load cpu utilization (max) %
3.cpu utilization(avg)
4. peak disk busy %
5. peak kb read
6.peak kb write
7.free memory
for... (3 Replies)
Does anyone know a way to use the mail command in perl as a one-liner? I am trying to do something like system("mail username@gmail.com -s Tester) but the only catch is to place the period "." after using the mail command in order to complete the command. I do not want to install any other 3rd... (2 Replies)
----------C program-----------------------------
include <stdio.h>
int main( int argc, char *argv )
{
int i;
for( i=0; i<argc; i++ )
printf("%\n", argv);
return 0;
}
I wrote the C program above 'print.c'.
Then, I compiled. (gcc -o print.o print.c)... (2 Replies)