English 中文(简体)
In Unixhell, how to Checkuser s ratification ,if theuser don t have, how to production a misnote?
原标题:In Unix shell, how to Check user s permission ,if the user doesn t have, how to produce an error message?

I was trying to write a script which will be able to perform some build-in command ,such as : cp, rm, ls or whatever. The menu might be like this:

  1. list the current directory
  2. Rename a file
  3. Remove a file
  4. exit

when you executed that some commands like "ls -la $currentdirectory" which will show almost all the information of the current directory.

缩略语:如果用户没有许可,(用户没有批准该名录的“最低生活标准”。

what command can check the permission? How to produce an error message if that user does not have the permission? Cheers hope to get that answer.

问题回答

你不需要任何单独的指挥,才能在目录/档案上公布许可。 <代码>ls本身将产生错误的电文。

For example, I take away all permissions from everyone,

chmod 000 some_folder
ls some_folder/
ls: some_folder/: The file access permissions do not allow the specified action.

Most>Most 等系统中的指挥系统如果得不到足够的工作许可,就会自动用错误的电文 error误! 基本框架将注意不允许处境不利的用户/申请者经营。

grep -i umask ~/.profile /etc/profile 




相关问题
Signed executables under Linux

For security reasons, it is desirable to check the integrity of code before execution, avoiding tampered software by an attacker. So, my question is How to sign executable code and run only trusted ...

encoding of file shell script

How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How can I use exit codes to run shell scripts sequentially?

Since cruise control is full of bugs that have wasted my entire week, I have decided the existing shell scripts I have are simpler and thus better. Here is what I have so far svn update /var/www/...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

热门标签