To understand which version you are on you might eventually consider some really farfetched idea, like telling us this information. Issue
and post the output.
Quote:
Originally Posted by Abstract3000
i get the following error
I think the problem is with the missing spaces. As far as i know ksh needs spaces around the double brackets. Either this or you use ksh88 and this does not understand every infix notation. Try one of those instead (notice the additional spaces!):
Quote:
Originally Posted by Abstract3000
as for the Version of Ksh, I'm pretty sure it predates the paleolithic era
I don't think so. Which version exactly you have would depend on the version of AIX (see above) but in general AIX uses a ksh88 as /usr/bin/ksh and as default shell and has a ksh93 as /usr/bin/ksh93.
Quote:
Originally Posted by Abstract3000
as for the the istat (inode) command I have not tried that, looked at it previously but couldn't find any sort of modifiers or description on how to extract just the file size
istat is the correct method of getting inode information. According to this link which not only provides a thorough explanation of what it does but also a sample output it will look like:
To understand which version you are on you might eventually consider some really farfetched idea, like telling us this information. Issue
and post the output.
I think the problem is with the missing spaces. As far as i know ksh needs spaces around the double brackets. Either this or you use ksh88 and this does not understand every infix notation. Try one of those instead (notice the additional spaces!):
I don't think so. Which version exactly you have would depend on the version of AIX (see above) but in general AIX uses a ksh88 as /usr/bin/ksh and as default shell and has a ksh93 as /usr/bin/ksh93.
as for the the istat (inode) command I have not tried that, looked at it previously but couldn't find any sort of modifiers or description on how to extract just the file size
Thanks for taking the Time in explaining that for me. I tried a simple command that told me the version was 3, but I don't believe that is specific enough so I will give that a shot when I'm back at the terminal next week, I will also look into iNode and the Arithmetic options you gave me and see what I can gather.
Quote:
Originally Posted by Corona688
Same problem as before. Without escaping, $5 will evaluate before ssh happens.
Thank you for the Explanation
This User Gave Thanks to Abstract3000 For This Post:
I tried a simple command that told me the version was 3
I don't know (and, in fact, can't even start to imagine) which simple command that might have been: the Korn shell comes in two "versions" (actually rather "language standards", like "FORTRAN77", than versions): "ksh88" basically means compatible to the version which was released 1988, eventually minus bugs in the original corrected since then and "ksh93" (the same but for the enhanced version released 1993).
You get the real version information for both of them in the following way: display the content of the system-variable ${.sh.version}. For my system i get:
This means it is a ksh93 and the version is "u+" from 2012, as ksh93 versions are "numbered" by characters: a, b, c, ... If i remember correctly the latest version of ksh93 is "w", so mine is pretty up to date.
Hi,
I created a skript in ksh which generate a file with semicolon as separator, this is an example of the file a created:
example content file:
hello;AAAA;2014-08-17
hello;BBBB;2014-08-17
hello;CCCC;2014-08-17
I would need to compare the content in of the second column of this file... (3 Replies)
Hi,
I am running a script that connets to a list of servers with SSH and runs a command but I have some servers that are asking for password (authorized keys is not configured properly).
Is there any way to do so that if I get a prompt for password just skip that entry?
my script:
... (1 Reply)
Hello,
I have an output file showing database sizes across the 3 environments that I use (LIVE, TEST & DEVELOPMENT).
I am trying to write a script that lets me know if the size of a db on one environment is different to its corresponding db on the other environments.
Here is an example... (4 Replies)
I need to write a bash script larger X Y that compares the sizes of two specified files X and Y,
and reports which file is larger. For example, if X is larger, the output should be "File X is larger",
while if Y is larger, the output should be "File Y is larger".
If the files are exactly the... (3 Replies)
Hi everyone!
I need to compare two file sizes.
One of them (size) will be stored in a flat file and the other coming from a listed file.
I can now get the first file size using:
SIZE=`ls -l $DOCTYPE | awk '{print $5}'`
1. How can I store this value in a flat file?
2. How... (2 Replies)
I need to get a file size and compare it to a previous day file size. If it's larger or smaller by 50 percent I'll replace the new with the old. I know how to get the file sizes but do not know how to calculate if it's 50 percent difference.
Thanks for your help. (2 Replies)
Hello,
I am working with KSH on AIX and I have 2 files generated from different sources... as seen below:
FILE1 FILE2
AAA AAA@ABS0001C
BBB BBB@ABS0003D
CCC CCC@ABS0023A
DDD DDD@ABC0145D
EEE EEE@ABS0090A
FFF FFF@ABS0002A
GGG GGG@ABC0150D
HHH
FILE1 is main main data source,... (4 Replies)
hi
ls -l * | sed 's/\+/ /g' | cut -f5 -d " " >out1
ls -l * | sed 's/\+/ /g' | cut -f5 -d " " >out2
diff out1 out2
i tried this it will work fine and i can see difference
but i need a script which should neglect, if the difference b/w files is small
and
it should display... (5 Replies)
Hello every one,
Iam newbie to this forum and shell programming &scripting.
i needed to compare each and every folder of two separate servers.
Actually I have copied some directory structure from one server to second server, to build on second server the files all should be copied... (3 Replies)
Is there a command that will return the name of the largest file within a directory? If so, can I set the returned filename into a variable? (4 Replies)