Hello Guys,For my homework I must write a shell script to do this serie,
I know that I must use the "bc" for that, but for the script's itself i have no idea,(beginner)
Can you plz just help me for have some idea?
Thanks
I wrote a program baut it does not work,
#!/bin/sh
echo "Input number"
read n
counter=0
ans=1
while [ $counter -ne $n ]
do
ans=`expr 4*(-1/(2*$count
I need to get total number of rows in a table by using select count(*) from table and need to assign into a variable in shell script.
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
A script that takes any number of directories as command line arguments and then lists the contents of each of these directories.
I am looking for a shell script where counter needs to be set for input paramter and do action once the count reaches to 5. The problem is there could be n number of input parameter and action should also be dependent on time ...
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Trying to run script but everytime I do I get teh following error message
line 4: [1: command not found
I have attempted different version but still come up with same results.
2.
Hi all,
Could you please let me know how to return back the value calculated from a shell script to the main script from where its called from.
shell: KSH
example: i have two shell scripts a.sh and b.sh.
i am calling b.sh from a.sh and in b.sh suppose i calculate the word count and other calculations, How can i pass this value calculated from this b.sh script back to a.sh
example code a
So I have the following shell script for batch renaming the episodes of some given TV series:
#!/bin/bash
#script for renaming files of form "*01*.ext" to "Episode 01.ext";
counter=0
for all_files in * ; do
counter=$(( $counter+1 )) #increments $counter by 1;
#creates counter "number" with two digit format (eg: 01):
if [[ 1 = $(( $counter<10 )) ]] ; then
number=0$counter
else
Hello All,
I have a problem in counting number of process getting run with my current script name..
Here it is
Code:
ps -ef | grep $0 | grep -v grep
This display just one line with the PID, PPID and other details when i print it in the script.
But when I want to count the numbers in my script , just like below, it comes out as 2...
My script work on Linux but not work in sun os.
my script.
Code:
logFiles="sentLog1.log sentLog2.log"
intial_time="0 0"
logLocation="/usr/local/tomcat/logs/"
sleepTime=600
failMessage=":: $(tput bold)Log not update$(tput rmso) = "
successMessage="OK"
arr=($logFiles)
time_arr=($intial_time)
arrlen=${#arr[@]}
arrcount=()
date
for count=0