Search Results

Search: Posts Made By: sprocket
4,656
Posted By sprocket
YES!! It Worked :) Thank you!!
YES!! It Worked :)

Thank you!!
4,656
Posted By sprocket
I did that but still received the same output,...
I did that but still received the same output, so:

I tried this:
#!/bin/bash

read -p "Please enter a number to represent epoch time:" STRING
echo "The UNIX time for $STRING is:" $($((date...
4,656
Posted By sprocket
#!/bin/bash read -p "Please enter a number...
#!/bin/bash

read -p "Please enter a number to represent epoch time:" STRING
echo "The UNIX time for $STRING is (date -d@$"STRING" +%m-%d-%Y %T -utc)"

Output: Please enter a number to represent...
4,656
Posted By sprocket
When I ran the code with the @ symbol - it...
When I ran the code with the @ symbol - it returns

date: invalid date '@String'

should I rename STRING to something else? or am I missing a parameter with this code? I took a scripting class...
4,656
Posted By sprocket
Converting a random epoch time into a readable format
I am trying to create a script that will take epoch (input from command line) and convert it into a readable format in bash/shell

---------- Post updated at 08:03 PM ---------- Previous update was...
Showing results 1 to 5 of 5

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