10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hello. I'm self teaching myself and coded a program but I keep getting a illegal division by 0 error. I know what it means but I don't know where I am messing up.
Here is the code:
#!/usr/bin/perl
@lines = <>;
my %earned;
my %possible;
for ($i = 1; $i <... (6 Replies)
Discussion started by: Eric7giants
6 Replies
2. Shell Programming and Scripting
I have the logic below to look up for matches within the columns between the two files with awk.
In the if statement is where the string comparison is attempted with ==
The issue seems to be with the operands, as
1. when " '${SECTOR}' " -- double quote followed by single quote -- awk matches... (1 Reply)
Discussion started by: deadyetagain
1 Replies
3. Shell Programming and Scripting
It is ok when I send send one arguement to $TILL in the awk expression.
first(){
TILL=$1
echo $TILL
awk '/:\\/ {P=0} P {print $0 "<br>"} FNR==1{printf("File %s:<br>", FILENAME)} /'$TILL'\/ {P=1} ' ${dirlist
}
}
echo "<table border = '1'>"
echo '<tr><td> </td><td>' ;... (3 Replies)
Discussion started by: alvinoo
3 Replies
4. UNIX for Dummies Questions & Answers
Hi Guys,
When I am executing the script
#! /bin/bash
SARBACKUPS=/home/pradeep/sarBackups
cd /var/log/sysstat
ls -1t sar* | while read SARNAME
do
cp -p "$SARNAME" $( echo "$SARBACKUPS"/"$HOSTNAME"_"$SARNAME"_"`date +"%Y%m%d`.bkup )
done
I am getting
final.sh: 1: Syntax... (3 Replies)
Discussion started by: Pradeep_1990
3 Replies
5. UNIX for Dummies Questions & Answers
I have list of data I have cut down to format:
I am using sed command to remove the sed 's/
Returns error:
sed: -e expression #1, char 5: unterminated `s' command
Full code line is:
cat textFile | cut -d ' ' -f 4 | cut ':' -f 1 | sed 's/
Thanks,
Please use next time code tags... (2 Replies)
Discussion started by: maximus73
2 Replies
6. Shell Programming and Scripting
I have read many threads, but I still didn't find the right answer. May be i didn't find the right thread, though are so many threads for the same question.
Basically the situation is - find date in a file and replace it with another date. (its not homework, its part of lot of a big processing,... (10 Replies)
Discussion started by: avinthm
10 Replies
7. Shell Programming and Scripting
Hello!
I wroted a little script that should check for new updates on a server and get them if any. The problem is, every time I run it with sh, I'm getting an "script: 20: Syntax error: Unterminated quoted string" error!
The problem is, there isn't any "unterminated quoted string" in my script:... (2 Replies)
Discussion started by: al0x
2 Replies
8. Shell Programming and Scripting
Hi,
I have been trying to get various sed statements to work. I thought I had cracked it when suddenly I start recieving these messages
"sed: -e expression #1, char 14: unterminated 's' command"
It happens on any sed statement I now run. The only thing I have done inbetween trying to get... (0 Replies)
Discussion started by: mcclunyboy
0 Replies
9. Shell Programming and Scripting
Hi there,
I'm pretty new to this whole scripting thing. I've written myself something which takes my txt file of SMSes (the backup from the phone), and puts them into an email format, saving them as .eml files. I've tested and uploaded a batch to gmail, but because of threading issues, I've... (1 Reply)
Discussion started by: donnacha
1 Replies
10. Shell Programming and Scripting
I keep having problems when exicuting this file. It always gives me the error message "36: Syntax error: Unterminated quoted string"
If someone could help me edit this it would be much appreciated.
#!/bin/sh
#
# This will continue adding numbers
# untill the total is greater than 1,000
#... (5 Replies)
Discussion started by: evilSerph
5 Replies