I've just started learning bash yesterday and I need a little help. I need to make a script that will check if a file exists on co-workers computers and, if it doesn't the, script will make one. I have a general idea for that. The more important help I need is recording or logging the script to an output.txt or something of the sorts. I've seen the script command but it seems to be manual. I need it to record every interaction from the start to end and then export it and exit.
I could probably test if that log exists and then append whatever the script needs to check. I assume to start I could do file="./file" (example) and then do
if [ -e "$file" ]; then whatever.
This is very simple script just check the existense of file, if so just move it to yourlocaiton dir.
#!/bin/sh if [ -f /etc/cruelworld.txt ] ; then echo "File exist and moving it to my dir" mv /etc/cruelworld.txt /yourlocation fi