Другой способ отображения объектов в консоли - JSON.stringify
. Оформить заказ ниже:
var gandalf = {
"real name": "Gandalf",
"age (est)": 11000,
"race": "Maia",
"haveRetirementPlan": true,
"aliases": [
"Greyhame",
"Stormcrow",
"Mithrandir",
"Gandalf the Grey",
"Gandalf the White"
]
};
//to console log object, we cannot use console.log("Object gandalf: " + gandalf);
console.log("Object gandalf: ");
//this will show object gandalf ONLY in Google Chrome NOT in IE
console.log(gandalf);
//this will show object gandalf IN ALL BROWSERS!
console.log(JSON.stringify(gandalf));
//this will show object gandalf IN ALL BROWSERS! with beautiful indent
console.log(JSON.stringify(gandalf, null, 4));
попробуйте это
TEMP=$(mktemp) # create unique tempfile
while read line; do # read one line from inputfile
# do what you want, e.g
echo "($line)" >> $TEMP # only an example
done < inputfile # use inputfile in while-loop
cat $TEMP
rm $TEMP # remove tempfile