Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-15-2008, 09:39 AM   #1
Registered: Mar 2008
Posts: 108

Rep: Reputation: 16
Problem with my 5 line script

Following on from a question I posted in another thread but should have started my own thread for...

Can you see a problem with this script?

n=$( date | awk $3);
if [$n =< 7]; then
echo "do the thing";
I can't figure why I get the error: "line 3: 7: No such file or directory", 7 is an integer so why does it think it's supposed to be a file or directory?
Old 04-15-2008, 09:49 AM   #2
Senior Member
Registered: Sep 2005
Distribution: Slackware
Posts: 1,442

Rep: Reputation: 71
I think you want
n=$( date +%d );
if [ $n -le 7 ]; then
echo "do the thing";
Old 04-15-2008, 09:53 AM   #3
Registered: Mar 2008
Posts: 108

Original Poster
Rep: Reputation: 16
wow, thanks!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
bash shell script read file line by line. Darren[UoW] Programming 57 04-17-2016 07:07 PM
script to check the last line in a file is blank line or not naveensankineni Programming 10 03-02-2008 12:13 AM
Problem understanding line in script snowman81 Programming 3 02-09-2008 10:58 PM
How to identify a line and replace another string on that line using Shell script? Sid2007 Programming 10 10-01-2007 09:49 PM
shell script find a line and the next line (grep?) metalx1000 Programming 5 07-24-2007 09:41 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:45 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration