Sponsored Content
Top Forums Shell Programming and Scripting identify whether idrectory or ordinary file Post 88511 by vino on Saturday 5th of November 2005 05:02:49 AM
Old 11-05-2005
Quote:
Originally Posted by surjyap
is there any other command or technique available?
Yes.

This one just popped out of my head. Very unconventional tho'...

Use rm

Look at the demo below.

Code:
sh-2.05b$ mkdir suryap
sh-2.05b$ ls -l
drwxr-xr-x    2 -------- g900         4096 Nov  5 01:58 suryap
sh-2.05b$ rm suryap/
rm: cannot remove `suryap': Is a directory
sh-2.05b$ rm -r suryap/
sh-2.05b$ ls -l suryap
ls: suryap: No such file or directory

Code:
sh-2.05b$ touch suryap
sh-2.05b$ ls -l
-rwxr-xr-x    2 -------- g900         4096 Nov  5 02:00 suryap
sh-2.05b$ rm suryap
sh-2.05b$ ls -l suryap
ls: suryap: No such file or directory

vino
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Newbie question about difference between executable file and ordinary file

Hi, I am newbie in unix and just started learning it. I want to know what is the difference between an executable file and a file (say text file). How to create executable file? What is the extension for that? How to differentiate ? How does it get executed? Thanks (1 Reply)
Discussion started by: Balaji
1 Replies

2. IP Networking

problem using rsh for ordinary users!

Hello, I'm going to use the remote tape via rsh , I think that all the necessary process have been done as below: (suppose the machine name that want to use tape is : m1 & the source machine is: m2 ) 1-in m2 machine i add: + m1 in .rhosts... (8 Replies)
Discussion started by: nikk
8 Replies

3. Shell Programming and Scripting

Identify type of file

hi all, i have the next question: how can i identify the type of a file? . I'm working in Unix (Solaris 5.7) and i would like identify if a file is or not is a "flat file". I need have a program what separates the flat file in a directory, and the excel file in another directory. I must get... (1 Reply)
Discussion started by: DebianJ
1 Replies

4. HP-UX

heads up unable tp login using ordinary account

Hi Mentors, I have a unix box HPC8000 HPUX 11.11 had just a problem loging in on CDE using ordinary account. The problem looks like this when an ordinary account will login to it will automatically closed and the login promtp will appear. If the root will login no problem at all. I tried... (0 Replies)
Discussion started by: eykyn17
0 Replies

5. AIX

[Help] Give privilege to an ordinary user

I'm trying to give a non-root user the right to start IBM HTTP Server, the web server is listening on port 80, but for AIX, ports under 1024 are privilege ports which can be used only by root. /usr/IBMIHS/bin# ./apachectl start (13)Permission denied: make_sock: could not bind to address :::80... (1 Reply)
Discussion started by: ibmer414
1 Replies

6. Linux

grant root privileges to ordinary user

Hi, Is it possible to grant root privileges to an ordinary user? Other than 'sudo', is there some way under Users/Groups configuration? I want ordinary user to be able to mount, umount and use command mt. /Brendan (4 Replies)
Discussion started by: brendan76
4 Replies

7. UNIX for Dummies Questions & Answers

How to give an ordinary user the superuser (root) ID which is 0

How to give an ordinary user the superuser (root) ID which is 0 (9 Replies)
Discussion started by: sharaola
9 Replies

8. Shell Programming and Scripting

wanted to find both link file and ordinary file using single find command

find . -type fl o/p is only the ordinary file. where in it wont give the link files. (2 Replies)
Discussion started by: nikhil jain
2 Replies

9. Shell Programming and Scripting

Compare large file and identify difference in separate file

I have a very large system generated file containing around 500K rows size 100MB like following HOME|ALICE STREET|3||NEW LISTING HOME|NEWPORT STREET|1||NEW LISTING HOME|KING STREET|5||NEW LISTING HOME|WINSOME AVENUE|4||MODIFICATION CAR|TOYOTA|4||NEW LISTING CAR|FORD|4||NEW... (9 Replies)
Discussion started by: jubaier
9 Replies
platform::shell(n)					       Tcl Bundled Packages						platform::shell(n)

__________________________________________________________________________________________________________________________________________________

NAME
platform::shell - System identification support code and utilities SYNOPSIS
package require platform::shell ?1.1.4? platform::shell::generic shell platform::shell::identify shell platform::shell::platform shell _________________________________________________________________ DESCRIPTION
The platform::shell package provides several utility commands useful for the identification of the architecture of a specific Tcl shell. This package allows the identification of the architecture of a specific Tcl shell different from the shell running the package. The only requirement is that the other shell (identified by its path), is actually executable on the current machine. While for most platform this means that the architecture of the interrogated shell is identical to the architecture of the running shell this is not generally true. A counter example are all platforms which have 32 and 64 bit variants and where a 64bit system is able to run 32bit code. For these running and interrogated shell may have different 32/64 bit settings and thus different identifiers. For applications like a code repository it is important to identify the architecture of the shell which will actually run the installed packages, versus the architecture of the shell running the repository software. COMMANDS
platform::shell::identify shell This command does the same identification as platform::identify, for the specified Tcl shell, in contrast to the running shell. platform::shell::generic shell This command does the same identification as platform::generic, for the specified Tcl shell, in contrast to the running shell. platform::shell::platform shell This command returns the contents of tcl_platform(platform) for the specified Tcl shell. KEYWORDS
operating system, cpu architecture, platform, architecture platform::shell 1.1.4 platform::shell(n)
All times are GMT -4. The time now is 11:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy