1752608 Members
4632 Online
108788 Solutions
New Discussion юеВ

command problem

 
neocosmic
Occasional Contributor

command problem

1. what's file descriptor?

2. how can i ensure that a command use only a certain amount of resources when it is excuted?

3.how to check the file contain unprintable characters?
5 REPLIES 5
Balaji N
Honored Contributor

Re: command problem

1. snipped from the open man page.

The open() system call is used to convert a pathname into a file
descriptor (a small, non-negative integer for use in subsequent I/O as
with read, write, etc.). When the call is successful, the file
descriptor returned will be the lowest file descriptor not currently
open for the process. This call creates a new open file, not shared
with any other process. (But shared open files may arise via the
fork(2) system call.) The new file descriptor is set to remain open
across exec functions (see fcntl(2)). The file offset is set to the
beginning of the file.


2. man bash and search for ulimit. it controls resources available for a shell and process started from it.

3. no idea.

hth
-balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
Ramkumar Devanathan
Honored Contributor

Re: command problem

Thanks balaji for answering 1. and 2. I was wondering how best to answer these unix theory questions.

for 3.)

# file should give you some details

# strings may be used.

FWIW.

- ramd.
HPE Software Rocks!
Balaji N
Honored Contributor

Re: command problem

u r welcome ram.

and fyi, strings prints only printable characters in a file. noway u can know of non-printable chars.

-balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
Ramkumar Devanathan
Honored Contributor

Re: command problem

Neocosmic,

Yup, balaji's right. that's why i'd mentioned the word 'use'...

- ramd.
HPE Software Rocks!
Clay Davidson
New Member

Re: command problem

To check for unprintable characters you could try

cat -v >

Then you can search the newfile for funny looking things like ^Z

hth,

clay