Hi all,
I have used a bash script which ultimately converts a string into date using date --date option:
Code:
DATE=$DATE" "$TIME" "`date +%Y` //concatenating 2 strings
TMRW_DATE=`date --date="$DATE" +"%s"` //applying date command on string and getting the unixtime
Moderator's Comments:
When i click on Dialog it gets Forceclose. works fine till November. but when i select December it gets forceclose.
Hi all,
I want to get a substring from a string based on given delimiter, for example:
Code:
str="foo|bar|baz"
with delimiter "|",
I want to get one substring at each time with the order number the substring in the whole string,
given 1 to get "foo",
given 2 to get "bar",
given 3 to get "baz",
I guess it could be done with sed and an regula
Hey guys,
Code:
a=`cat abc | wc -l`
b=`cat def | wc -l`
if $a== $b
then
echo "a"
else
echo "b"
fi
I want the if condition to retry itself , untill a==b.
I can't use goto statemt.
Please help.
Thanx in advance.
Moderator's Comments:
Please use next time code
Dear All,
I am new here.
I am trying to calculate the maximum number from four numbers input by the user. I have the following code, but it does not work. It says there's an error with the last line "done". Any help would be appreciated.
Code:
sort -t "~" -k 1.19,1.29 -k 2.1,2.5
in unix
- I have to understand what exactly this command will do ?:wall:
Moderator's Comments:
Please use code tags next time for your code and data.
Hi,
I am getting this error while running the following code.
Code:
i=`awk '{print $2}' test1.txt`
j=`awk '{print $4}' test1.txt`
k=`awk '{print $6}' test1.txt`
if [ $i =="Yes" && $j =="Yes" && $k =0 ]; then
echo "Up."
else
echo "down"
fi
rm -f test.txt test1.txt
error is this:
Code:
line 12: [: missing `]'
Please suggest.
i created a code that calculates informational entropy i.e lots of large sums times logs base 2. At fifth level entropy however, my code just stops and yields math range error. I was playing around with a frequency function I'm using, and I think I might have an int/float error. Has anyone run into this? Has anyone found a way around this?