If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Help in Validating UNIX Commands

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-13-08, 04:32
a1jit a1jit is offline
Registered User
 
Join Date: Feb 2005
Posts: 116
Help in Validating UNIX Commands

Hi Guys,

Im currently running unix aix using korn shell script.

Actually im in the process of studying some unix commands, just need your help to validate these commands, i have google i though, just need confirmation

while [ $var -lt 1 ]
Checks variable if it is less than 1 ?

if [ $var -ge 6 ]
Checks if its greater than 6 ?

if [ -e $1 ]
If the files specified in $1 Exists ?

if [ log1.log -nt log2.log ]
Checks if log1 modified date is less than log2 modified date?

script.sh >> script.log 2>&1
Appends output of script.sh to script.log and redirect standard error messages to the path specified in first parameter ?

The thing is that its easy to find commands reference in unix, commands like rm, ps -ef, grep, sed can be easily google, but certain certain commands like
-e or -nt , its quite difficult to find what it actually does, Im not sure if this is commands or just some attributes/flags. Its quite difficult to find reference on this type of attributes/flags
Reply With Quote
  #2 (permalink)  
Old 09-13-08, 16:34
Pat Phelan Pat Phelan is online now
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,612
When in doubt, write and test a short script to confirm your understanding.

-PatP
Reply With Quote
  #3 (permalink)  
Old 09-14-08, 09:04
a1jit a1jit is offline
Registered User
 
Join Date: Feb 2005
Posts: 116
thanks pat, i was browsing through one of the forums and found the link below, it contains some of the most frequently used file attributes and arithmetic operators

> http://www.metalshell.com/view/source/70/
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On