Search Results

Search: Posts Made By: ashish_neekhra
2,750
Posted By vinil
Got an error in above code .There is no variable...
Got an error in above code .There is no variable named var defined in your code.Re-check that.Below works as expected


#!/bin/bash
#var=1024
mem=`(cat /proc/meminfo | grep MemTotal)`...
2,750
Posted By Scrutinizer
In the script the var variable does not get set....
In the script the var variable does not get set. When you try the lines one by one it probably does have a value. Try:
echo "$var"

Probably you meant to use the mem variable.
mem_digit=`(echo...
15,227
Posted By sea
You have no echo command after the copy to...
You have no echo command after the copy to existing folder.
Add a message and you'll get one ;)

What if the creation of the folder fails?
So you could move the:
if [ $? -eq 0 ]
...
15,227
Posted By Aia
@Ashish Moved the if [ -d "${location}" ]...
@Ashish

Moved the if [ -d "${location}" ] inside the first successful if statement, since it is the only place that belongs, otherwise it will execute even when it is established that the file...
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 03:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy