Sort command using which directory


 
Thread Tools Search this Thread
Operating Systems HP-UX Sort command using which directory
# 8  
Old 03-04-2012
Hi,

I am still not able to find, why sort command is failing. I have set TMPDIR to /tmpdump (as shown above) which is of 8GB and same error. While sort command was running, I have executed df -k to see if size of directory is used or not. I noticed that

Code:
/tmpdump               (/dev/vg02/lvol2       ) :  8323520 total allocated Kb
                                                   8306200 free allocated Kb
                                                     17320 used allocated Kb
                                                         0 % allocation used

and it remains the same. Please let me know how to solve this problem.

Thank you.

---------- Post updated at 01:32 PM ---------- Previous update was at 12:57 PM ----------

I saw that

Code:
TMPDIR=/tmpdump
export TMPDIR

is setting the TMPDIR to the current session only, while script is used in some other session. I want to make this change persist along all the unix sessions. How to do that?

Please help.

Thanks.
# 9  
Old 03-04-2012
Is your filesystem set to largefiles?
What about your environment? (e.g. ulimit...)
# 10  
Old 03-04-2012
Quote:
Is your filesystem set to largefiles?
I didn't get that.

Which commands you want me to execute?
# 11  
Old 03-04-2012
Quote:
Originally Posted by manubatham20
is setting the TMPDIR to the current session only, while script is used in some other session. I want to make this change persist along all the unix sessions. How to do that?
Environment variables are not "global variables". There's no one place you can change it that will simultaneously change it for everyone.

Obvious way to do it: Run the export in the right session, not the wrong one.

More complicated way: Put it in the login scripts, perhaps /etc/profile, so the session you want will read it on login. You'll have to log out and log back in, or re-read the /etc/profile with . /etc/profile in the correct sesssion.

If your session is a cron job or something and doesn't even read those you'll have to set it manually because environment variables aren't globals and have to be read somehow.
# 12  
Old 03-05-2012
Quote:
TMPDIR=/tmpdump
export TMPDIR
Put this in the script containing the "sort" command.
Do not put it in /etc/profile or root's .profile because it refers to a filesystem which may not be mounted in every run state.


The "largefiles" option for fileystems is described in "man fsadm_vxfs", "man newfs_vxfs" and "man mkfs_vxfs". It allows you to create individual files larger than 2Gb. No really relevant to this thread.
Just for interest: To find out if you have any filesystems with "largefiles":
Code:
grep "largefiles" /etc/fstab | grep -v "nolargefiles"

This User Gave Thanks to methyl For This Post:
# 13  
Old 03-08-2012
Putting export in script solved my problem.

Many thanks to all for your valuable suggestions.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to sort files in directory numerically?

Trying to sort a bunch of files numerically but can't seem to get the command just right. This is in a IBM AIX machine. I have a directory that has... backup.bk1 backup.bk100 backup.bk2 backup.bk200 backup.bk3 backup.bk300 There are a lot more files but this is shortened for the... (5 Replies)
Discussion started by: c3rb3rus
5 Replies

2. UNIX for Beginners Questions & Answers

Sort by file/directory size

OS : RHEL 6.6 I want to list the files/directories sorted (Ascending or Desceding) by their size. As you can see in the below example, du command doesn't sort by size. In Linux world, is there any other command or workaround using du command to list the files/directories sorted by their... (6 Replies)
Discussion started by: John K
6 Replies

3. UNIX for Dummies Questions & Answers

Redirecting tmp files of SORT into different directory

Hey Guys, I am facing an annoying scenario, fewer times when I execute the sort command, it throws out on error saying that "No Space on available on /var/tmp/<temp file name>. May be it is set to /var/tmp directory. I was wondering, if I cant redirect the temporary file creation to any other... (3 Replies)
Discussion started by: abhisheksunkari
3 Replies

4. Shell Programming and Scripting

Is it Possible to sort a list of hexadecimal numbers using "sort" command?

Hello Everybody :) !!!. i have question in mind, is it possible to sort a list of hexadecimal numbers using "sort" command? (9 Replies)
Discussion started by: Kesavan
9 Replies

5. Shell Programming and Scripting

How to Sort Floating Numbers Using the Sort Command?

Hi to all. I'm trying to sort this with the Unix command sort. user1:12345678:3.5:2.5:8:1:2:3 user2:12345679:4.5:3.5:8:1:3:2 user3:12345687:5.5:2.5:6:1:3:2 user4:12345670:5.5:2.5:5:3:2:1 user5:12345671:2.5:5.5:7:2:3:1 I need to get this: user3:12345687:5.5:2.5:6:1:3:2... (7 Replies)
Discussion started by: daniel.gbaena
7 Replies

6. UNIX for Dummies Questions & Answers

Sort by size, then list file in each directory

Hi, I have directories with name like: aaa bbb ccc ... I would like to to see which directories are the largest and then list the files within each. I have success using: du -ks * | sort -rin | head -n 20 which gives me an output like: 120 bbb 27 ccc 3 aaa ... I would like... (3 Replies)
Discussion started by: ChatPerdu
3 Replies

7. UNIX for Dummies Questions & Answers

How can I sort the file names in the directory

Hi , I have a list of files in the directory I want to sort based on the file name. But in the middle of filename contains the number based on that I need to sort.Could you suggest me on the same? Example filenames: /user1$ls RS.DEV.ISV.F1.RS.REFDATA.DATA... (1 Reply)
Discussion started by: praveen.thumati
1 Replies

8. Shell Programming and Scripting

How to sort a set of files by date in a directory?

hi there, I have a directory which contents I can parse dynamically. I end up with a file list. I then want to display those files sorted by date, oldest files first. I have very very little PERL experience...Would anyone know how to do that ? Thanks in advance. (8 Replies)
Discussion started by: alexf
8 Replies

9. UNIX for Dummies Questions & Answers

Sort all files in a directory retaining originals

Hi, I need to sort all the files in a directory whilst retaining the originals. So if in the directory I have: File1 File2 File3 I want to sort these files so that I would have: File1 File1.sort File2 File2.sort File3 File3.sort where I have added the .sort extension to show... (4 Replies)
Discussion started by: ledgie
4 Replies

10. Shell Programming and Scripting

How to sort directory names and use only last?

I need help writing a bash script for the windows cygwin environment. I'm not sure if bash is the optimal tool. Perhaps perl would be better? Either would work. I have directories whose names include the date they were created. The directory names are in the format of... (0 Replies)
Discussion started by: siegfried
0 Replies
Login or Register to Ask a Question