02-02-2010
while loop in shell scripting
Thanks a lot for all ur replies.
Is there a way to change the code for my below requirement?
The code which i specified in the last post has initial count of the files in the dir.But the files get on decreasing after some time and atlast become 0.
But the while loop does not ge executed since the count is never 0 rather it has the initial count.
The loop shld continuously chk for the count and when it is 0 the statements shld be executed.
How will i keep track of the count ie ls = 0 of the dir.
Can someone please help me out soon....
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies
2. Shell Programming and Scripting
#!/bin/bash
for file in $HOME/*;
do
if ; then
rm -i $file > /dev/null
echo "$?"
echo "$file has been deleted"
fi
done
Been trying to learn shell scripting for a week or so now, when i run the script it doesnt display an error message, seems like it runs fine, however it doesnt delete... (10 Replies)
Discussion started by: stride6
10 Replies
3. Solaris
Hi below is my script
for((i=0;i<=$TOTAL;i++))
do
echo "IP's created are $s1.$s2.$s3.$s4"
s4=`expr $s4 + 1`
done
where s1,2,3,4 are input varibles
below error occurs while running the script
syntax error at lin 11: '(' unexpected
... (12 Replies)
Discussion started by: krevathi1912
12 Replies
4. Shell Programming and Scripting
Hi
How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Discussion started by: anupdas
2 Replies
5. Shell Programming and Scripting
Hi,
I'm using Ksh and I'm seeing some of code in my programme as given below.
Could you please let me know whats is this meeaing ?
(I'm new to this unix)
grep "1034" /u/kkk/bin/temp5.lst|cut -c1-2 >/u/kkk/bin/temp6.lst
if
then
echo ""
... (2 Replies)
Discussion started by: shyamu544
2 Replies
6. Shell Programming and Scripting
hi i was wondering if someone can help me with a while loop..i have been looking at this for hours and dont no wut to do..
i have to make a menu style.. to have a beeter understanding i have linked a photo at the bottom...
http://www.mypicx.com/uploadimg/772204432_08022011_1.pngand then
... (1 Reply)
Discussion started by: beerpong1
1 Replies
7. Homework & Coursework Questions
hi.. this is shell scripting lab15.sh
i dont understand this lab i am at the screen shot part. i was wondering if someone can take a quick look at this lab i have linked the doc below. i dont know where to start
i have did the
Required Errorlevels
Errorlevel # but dont... (1 Reply)
Discussion started by: beerpong1
1 Replies
8. Shell Programming and Scripting
Hi Team,
I have created a script and using FOR LOOP like this and it is working fine.
for Month in 201212 201301 201302 201303
do
echo "Starting the statistics gathering of $Month partitions "
done
But in my scripts the " Month " variable is hard-coded. Can you please any one... (3 Replies)
Discussion started by: shoan
3 Replies
9. Shell Programming and Scripting
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)
Discussion started by: karthikram
2 Replies
10. Shell Programming and Scripting
Hi,
I am using ksh , when i try to use for loop i am getting the expected output.
$for variable in $(ps -fu user | grep -i something/ | grep -i something | grep -v grep | awk '{print $2}');do
> grep $variable /tmp/some_path/*/*
> done
when tried the below to remote server, getting... (4 Replies)
Discussion started by: karthikram
4 Replies
stack(n) Tcl Data Structures stack(n)
NAME
stack - Create and manipulate stack objects
SYNOPSIS
package require Tcl 8.2
package require struct ?1.2.1?
stackName option ?arg arg ...?
stackName clear
stackName destroy
stackName peek ?count?
stackName pop ?count?
stackName push item ?item ...?
stackName size
DESCRIPTION
The ::struct::stack command creates a new stack object with an associated global Tcl command whose name is stackName. This command may be
used to invoke various operations on the stack. It has the following general form:
stackName option ?arg arg ...?
Option and the args determine the exact behavior of the command. The following commands are possible for stack objects:
stackName clear
Remove all items from the stack.
stackName destroy
Destroy the stack, including its storage space and associated command.
stackName peek ?count?
Return the top count items of the stack, without removing them from the stack. If count is not specified, it defaults to 1. If
count is 1, the result is a simple string; otherwise, it is a list. If specified, count must be greater than or equal to 1. If
there are no items on the stack, this command will return count empty strings.
stackName pop ?count?
Return the top count items of the stack, and remove them from the stack. If count is not specified, it defaults to 1. If count is
1, the result is a simple string; otherwise, it is a list. If specified, count must be greater than or equal to 1. If there are no
items on the stack, this command will return count empty strings.
stackName push item ?item ...?
Push the item or items specified onto the stack. If more than one item is given, they will be pushed in the order they are listed.
stackName size
Return the number of items on the stack.
KEYWORDS
queue, matrix, tree, graph
struct 1.2.1 stack(n)