Fixed script name for sinline as the original name caused failure. Ma…#23
Fixed script name for sinline as the original name caused failure. Ma…#23
Conversation
…ybe it was a special snowflake.
JamesOwers
left a comment
There was a problem hiding this comment.
So, as we discussed(!), I think this error is because the file already existed and, since somebody else made it, you get a permissions error because you can't overwrite it.
My proposed solution is to simply add the datetime to the filename, e.g.:
dt=$(date '+%d_%m_%Y__%H_%M_%S')
/tmp/bash_script_${dt}.sh
If that works for you, please may you add the change and I'll approve. 😘
|
Might be worth putting the username in the filename as well, just in case two people happen to run in the same second? (Probably unlikely, but it's an easy thing to add in advance) |
Good shout |
Adds the current date/time and username of the submitting user to the name of the temporary file created. This should avoid issues where the temporary file cannot be created because it already exists and belongs to another user.
|
Have changed the code to add date/time/username to the file name, but have not tested it. |
Fixed script name for sinline as the original name caused failure.
Maybe it was a special snowflake.