How to initialize a directory size to a variable??
Answers were Sorted based on User's Feedback
Answer / damodar rao
#!/bin/bash
echo 'enter the directory name with path Ex: /home/damoar: ';
read $x;
$size = `du -h $x`;
echo 'size of a given directory $x is : `$size` ';
:wq
| Is This Answer Correct ? | 3 Yes | 0 No |
I want to connect to a remote server and execute some commands, how can I achieve this?
There is a record with fields namely name,roll no.,salary,grade etc.Now,write a script to create a file with multiple records have same combination of fields but with unique roll numbers.The script should work for different names in the input file.
What are environment variables?
what are command line arguments? what is the need of those?
In my bash shell I want my prompt to be of format '$"present working directory":"hostname"> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?
What is echo in shell?
Determine the output of the following command: [ -z “” ] && echo 0 || echo 1
Hi All, Is it possible to create one file name only space or space in file name in UNIX and we can able to run that on Unix?
What's the difference between scripting and coding?
Is shell scripting difficult?
How to make userdefined variables to available for all other shells?
determine the output of the following command: echo ${new:-variable}