Answer Posted / swaroopa
The test command is particularly useful in this context
allowing a variety of conditions to be checked for. There
are two equivalent syntaxes.
test expression
and
[ expression ]
The following simple example will list all the
subdirectories of the current directory.
for i in *
do
if [ -d $i ]
then
echo $i
fi
done
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
How do scripts work?
What are the 3 standard streams in linux?
write a shell script to emulate the Id command of PRIMOS which lists files and directories. It list files first with a header FILES and then directories with a header DIRECTORIES. This command has several options. The main ones are. -file select files only -dir select directories only -reverse sort in reverse order -no_header put no header on the output -brief output the header only -size display the size of each file -help display Id´s syntax and options.
What is an inode block?
What is the equivalent of a file shortcut that we have a window on a linux system?
one folder contains lot of students name but I want to fetch hello with every student name individually using shell script
Explain about return code?
How do I run a bin bash script?
What is gui scripting?
What is the first line of a shell script called?
c program to implement unix/linux command to block the signal ctrl-c and ctrl-\ signal during the execution ls -l|wc -l
What is the use of "$?" Sign in shell script?
What are the different types of shell scripting?
Is shell and terminal the same?
How to calculate the number of passed arguments?