- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Error Token 13585
Operating System - Linux
1748089
Members
4772
Online
108758
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2007 12:30 AM
тАО03-15-2007 12:30 AM
Hi there --
I have a password notification script running on one of our systems, and for some reason the following error message appears whenever it is run:
/root/password_notify: line 8: 13517
13585 : syntax error in expression (error token is "13585 ")
The script in question is listed below, and line 8 begins with the text last_change:
#!/bin/bash
users=`grep -v ":\!\!:" /etc/shadow|grep -v ":\*:" |grep -v root|cut -f1 -d:` expire_time=90 today=$((`perl -le 'print time'` / 86400 ))
for user in $users ; do
last_change=$(( `grep $user /etc/shadow |cut -f3 -d:` ))
days_left=$(( $expire_time - $today + $last_change )) if [ $days_left -lt 15 -a $days_left -ge 0 ]; then
mail -s "Your password on the Hadron server will expire in $days_left days." $user << EOF Hello, Your password of account $user, which is used for accessing the e-mail server on host `uname -n`, will expire in $days_left days.
Please update your password. If you have any questions, please contact at extension x-yzab or e-mail him at for help.
Thanks for your support!
EOF
fi
done
Can someone tell me what the error message means, and what I need to do to correct it? Thanks.
I have a password notification script running on one of our systems, and for some reason the following error message appears whenever it is run:
/root/password_notify: line 8: 13517
13585 : syntax error in expression (error token is "13585 ")
The script in question is listed below, and line 8 begins with the text last_change:
#!/bin/bash
users=`grep -v ":\!\!:" /etc/shadow|grep -v ":\*:" |grep -v root|cut -f1 -d:` expire_time=90 today=$((`perl -le 'print time'` / 86400 ))
for user in $users ; do
last_change=$(( `grep $user /etc/shadow |cut -f3 -d:` ))
days_left=$(( $expire_time - $today + $last_change )) if [ $days_left -lt 15 -a $days_left -ge 0 ]; then
mail -s "Your password on the Hadron server will expire in $days_left days." $user << EOF Hello, Your password of account $user, which is used for accessing the e-mail server on host `uname -n`, will expire in $days_left days.
Please update your password. If you have any questions, please contact
Thanks for your support!
EOF
fi
done
Can someone tell me what the error message means, and what I need to do to correct it? Thanks.
A Journey In The Quest Of Knowledge
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2007 03:51 AM
тАО03-15-2007 03:51 AM
Solution
It would seem that the "grep" command on line 8 has produced two hits instead of one, namely:
13517
13585
Let me guess: you have two users so that one username is a substring of the other, right?
For example, "foo" and "foobar". This (or something similar) caused "grep" to produce a two-line output.
When grepping users from /etc/passwd or /etc/shadow, never do just "grep $user". Instead, you'd better do something like:
grep "^${user}:"
to specify that you'll want to match the username exactly: substring matches in the username and matches elsewhere on the line (gecos information!) are not accepted. If you don't do this, you'll get bitten sooner or later.
You can simulate this situation by typing this on the command line (after backslash, press Enter):
last_change=$(( 13517 \
13585 ))
This will produce the error message:
bash: 13517 13585 : syntax error in expression (error token is "13585 ")
which matches what you got from your script.
13517
13585
Let me guess: you have two users so that one username is a substring of the other, right?
For example, "foo" and "foobar". This (or something similar) caused "grep" to produce a two-line output.
When grepping users from /etc/passwd or /etc/shadow, never do just "grep $user". Instead, you'd better do something like:
grep "^${user}:"
to specify that you'll want to match the username exactly: substring matches in the username and matches elsewhere on the line (gecos information!) are not accepted. If you don't do this, you'll get bitten sooner or later.
You can simulate this situation by typing this on the command line (after backslash, press Enter):
last_change=$(( 13517 \
13585 ))
This will produce the error message:
bash: 13517 13585 : syntax error in expression (error token is "13585 ")
which matches what you got from your script.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2007 05:18 AM
тАО03-15-2007 05:18 AM
Re: Error Token 13585
Hi there --
I made the change you suggested to the script, and when it was rerun, it did not return an error message. I will keep an eye on it, and if there are any further problems, I'll let you know. Thanks.
I made the change you suggested to the script, and when it was rerun, it did not return an error message. I will keep an eye on it, and if there are any further problems, I'll let you know. Thanks.
A Journey In The Quest Of Knowledge
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP