hey sorry, i wrote the description but don't lnow how it got erased.
i have a set of commands inside a text file. 1 command per line.
command.txt
i want to execute these commands one by one and after finishing the last command, again it should start from the 1st command.
infinity.sh
the commands are not getting executed.
So, you are trying to set a variable variable name then. Have you considered using an array?
Of course, this is assuming that you have a simple value to store in your variable. The output you have given us suggests that you want to store the output from ls -l in a variable. I'm not really sure that is a good thing to attempt.
Are you actually after storing the return code instead? In that case, change the line:-
to be:-
There is also a limit to the number of items in the array, 0-1023 in ksh, 4 million in ksh93. Not sure on the bash limit.
WARNING - your logic is dangerous.
Imagine if someone could infect your input file and add any of the following:-
I hope that this helps / gives you something bigger to consider.
Hi,
i have a source file and have 3 columns and separated by "|" .i want to split this 3 columns in different variable.When i am executing this values indivisually giving correct result but when the same execute inside a for loop,it's giving issues.
Src file(jjj.txt)
-------... (8 Replies)
Hi ,
I am trying to read a list of hosts from a config file and trying to get file list from that host. For this I have used one while loop.
cat "$ARCHIVE_CFG_FILE" | sed '/^$/d' | sed '/^#/d' | while read ARCHIVE_CFG
do
SOURCE_SERVER_NAME=`echo "$ARCHIVE_CFG" | awk -F '|' '{ print... (2 Replies)
Hi ,
Please excuse me for opening a new thread i am unable to find out the syntax error
in my if else condition inside for loop in awk command ,
my actual aim is to print formatted html td tag when if condition (True) having string as "failed",
could anyone please advise what is the right... (2 Replies)
I have a below command
ALTER TABLE `abc` ADD PARTITION ( PARTITION 20130613 VALUES less than (DAY('13')));
Below is requirement
It runs in Loop
as DAY start with 13 and end with 100 along with this of counter "20130613" also increases per command
as the next command should be
... (8 Replies)
I tried this:
for region in 'raj' 'kt' 'kol' 'krl' 'chn' 'dl' 'hr' 'bih' 'ap'
do
sqlplus -s huw$region/`echo $region`huw#321@huw$region<<!
set serveroutput on
begin
select count(*) from tcd_preferred_cust_201109
end;
/
exit;
done
but the error shows like:
Syntax error at line 4 :... (1 Reply)
in one of my script..I have some thing like
john:christina : one::
and i want to make it like
john:chritina:two:(date command):jackey:
basically change 'one' to 'two' and run date :command and add other name: (30 Replies)
Hello,
I have a set of input data that I split into batches using the following command:
split -l 4000000 MyInput.in Split_a
Once I get the split files, I run a certain command on the split files that spews an output. So far I have been doing it without a for loop. How can I translate the... (2 Replies)
I have a command nested in some while loops to parse some data that looks something like this.
while ($condition)
while ($condition)
...
gzcat /dir/$fileName.gz | grep $searchString > out_file
end
end
On the first loop, the command is executed properly (and takes maybe 10... (3 Replies)