#!/bin/bash
if [ -f "$1" ] #parameter is file name, if i exists...
then
VARIABLE=`cat "$1"` #assign what's inside into VARIABLE
fi
I've tried bash -x script_01.sh "file"
and the tracing works:
+ '[' -f file ']'
++ cat file
+ VARIABLE='Wednesday, November 4, 2015 04:45:47 PM CET'
But the problem is that when I echo $VARIABLE, it's empty. Do you guys have any tips on how to make it work? Thank you.