11-27-2008
Extra output in the script
Hi ,
I am trying to execute the following script.
#!/bin/sh
find . -name "common.log.diff"
if [$? -eq 1]; then
cp common.log common.log.diff
diff common.log common.log.diff > DIFFERENCE.log
cp common.log common.log.diff
grep "ERROR" DIFFERENCE.log
if [ $? -eq 0 ]; then
echo "1"
else
echo "0"
fi
else
diff common.log common.log.diff > DIFFERENCE.log
cp common.log common.log.diff
grep "ERROR" DIFFERENCE.log
if [ $? -eq 0 ]; then
echo "1"
else
echo "0"
fi
fi
This is giving the following output.
./testscript
./common.log.diff
./testscript[3]: [0: not found.
0
In this " 0 " is fine. But I dont know why it is
giving
./common.log.diff &
./testscript[3]: [0: not found.
along with "0"
Kindly suggest. What wrong with my script ?
Regards
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have two issues with this script.
1. I cannot seem to get my counters to count correctly.
2. My function to eject to CAP1 or CAP2 is hung in a loop and doens't exit back to the previous function. I would like to be able to select which cap to eject to . Each cap holds only 40 tapes, so when one... (15 Replies)
Discussion started by: gzs553
15 Replies
2. Shell Programming and Scripting
I am new to scripting and I needed to know if there would be an easy way to delete extra spaces in a text file. I have a file with three rows with 22 numbers each, but there is extra spaces between the numbers when it gets output by this program AFNI that I am using. What script would help delete... (2 Replies)
Discussion started by: hertingm
2 Replies
3. Filesystems, Disks and Memory
hi fren
i am facing this problem
i have sun 6140 storage
30 volumes
bt my vxdisk list output is showing 37 disk
which shd nt b there
has neone faced this proble earlier
vxdiks list output is like this
SUN6140-2_0 auto - - online c4t201700A0B84853C0d2s2
SUN6140-2_1 auto - - online... (13 Replies)
Discussion started by: bond_ankur
13 Replies
4. Shell Programming and Scripting
Hey everyone,
I have a problem with a certain shellscript. I have a script like this:
#!/bin/sh
template=$1
for values in {60,150,240,330}\ {60,150,240,330}\ {60,150,240,330}\ {60,150,240,330}; do
set $values
X=$1; Y=$2; Z=$3; M=$4
mkdir "X$X-Y$Y-Z$Z-M$M"
cp... (2 Replies)
Discussion started by: mario8eren
2 Replies
5. Shell Programming and Scripting
I am running a sql session within a shell script. Later I am performing some validations on the value coming from the sql session.
The problem is that, the value I am getting from sql session have an extra white space at the begining(I am actually, assigning the outcome of the sql session to a... (5 Replies)
Discussion started by: mady135
5 Replies
6. Shell Programming and Scripting
I have a file which contains certain records about users. the row length is always fixed to 205 characters.
Now I want to read each record line from the file, substring some portion out of it and put into another file. But I have observed that my script is trimming the extra spaces I have used for... (4 Replies)
Discussion started by: Pramit
4 Replies
7. Shell Programming and Scripting
Hi Freinds ,
I have 2 files .
File 1
|nag|HYd|1|Che
|esw|Gun|2|hyd
|pra|bhe|3|hyd
|omu|hei|4|bnsj
|uer|oeri|5|uery
File 2
|nag|HYd|1|Che
|esw|Gun|2|hyd
|uer|oi|3|uery
output : (9 Replies)
Discussion started by: i150371485
9 Replies
8. Shell Programming and Scripting
Hi All
I am trying to perform the below operation -count=`cat abc.txt | wc -l`
echo$count
5
Head=Start"$DATE"00000"$count"File
echo $HEAD
START15020300000 5File
There is a space coming before 5 which is not needed . How to ignore that . (4 Replies)
Discussion started by: honey26
4 Replies
9. Shell Programming and Scripting
Gents,
I did a small scritp called make_file
It read file1.txt file and generate an output as attached.. But the script is showing more extra information not needed.
I have attached the output file as desired.
Could you please help to fix this scrip to get the correct output
Thanks... (4 Replies)
Discussion started by: jiam912
4 Replies
10. UNIX for Beginners Questions & Answers
Hi,
We have created a script that's checks the latency of IIDR subscription by fetching details from a config file (that contains subscription details) and running the CHCCLP command. The out put is then concatenated in a csv file. Once all subscription details are saved the script send a mail... (7 Replies)
Discussion started by: ab095
7 Replies
LEARN ABOUT MOJAVE
git-whatchanged
GIT-WHATCHANGED(1) Git Manual GIT-WHATCHANGED(1)
NAME
git-whatchanged - Show logs with difference each commit introduces
SYNOPSIS
git whatchanged <option>...
DESCRIPTION
Shows commit logs and diff output each commit introduces.
New users are encouraged to use git-log(1) instead. The whatchanged command is essentially the same as git-log(1) but defaults to show the
raw format diff output and to skip merges.
The command is kept primarily for historical reasons; fingers of many people who learned Git long before git log was invented by reading
Linux kernel mailing list are trained to type it.
EXAMPLES
git whatchanged -p v2.6.12.. include/scsi drivers/scsi
Show as patches the commits since version v2.6.12 that changed any file in the include/scsi or drivers/scsi subdirectories
git whatchanged --since="2 weeks ago" -- gitk
Show the changes during the last two weeks to the file gitk. The "--" is necessary to avoid confusion with the branch named gitk
GIT
Part of the git(1) suite
Git 2.17.1 10/05/2018 GIT-WHATCHANGED(1)