Hi Team,
my question is how to declare the out of dt in the path have clarification in the last line
pt = "/path/of/the/file.txt"
dt=`date`
echo "$dt" >> $pt
Regards
Kanna
declaring the variable doubt in shell
Re: declaring the variable doubt in shell
Eh? What?
In "shell speak" you should get the output of the date command appended in the file /path/of/the/file.txt (assuming path exists, have write permission se labels and so on).
You don't "declare" output types (although you can declare variables).
In "shell speak" you should get the output of the date command appended in the file /path/of/the/file.txt (assuming path exists, have write permission se labels and so on).
You don't "declare" output types (although you can declare variables).
Re: declaring the variable doubt in shell
This works:
#!/bin/bash
pt="test.txt"
dt=`/usr/bin/date`
echo $dt > $pt
#!/bin/bash
pt="test.txt"
dt=`/usr/bin/date`
echo $dt > $pt
Re: declaring the variable doubt in shell
thank you it worked
Re: declaring the variable doubt in shell
You could also do:
#!/bin/bash
pt="test.txt"
echo $(/usr/bin/date) > $pt
#!/bin/bash
pt="test.txt"
echo $(/usr/bin/date) > $pt