Friday, April 26, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 3051  / 1 Year ago, sun, april 2, 2023, 3:35:26

My script is as follows:



#!/bin/sh

rm -rfv /home/user/Documents/Exercise/*

cp -rfv /home/user/Documents/ExerciseShare/ExerciseFiles/Word/Advanced/ /home/tp3/Documents/Exercise/


If i was to run these commands individually via Terminal they run ok. I have put them in a script (as above) and when I attempt to tun the script the Terminal windows flashes for about a second and nothing happens.



My attempts at solutions:




  1. Adding wait to the end of the script - no luck

  2. Right Click Script > Properties > Permissions > Execute - set

  3. Attempted to Run and Run in Terminal - no luck



I am using Ubuntu 12.10 64-bit


More From » 12.10

 Answers
4

After many more hours of tinkering I have found an unlikely answer.



I created a new blank document and added only the two lines I wanted (without the heading of #!/bin/sh) :



rm -rfv /home/user/Documents/Exercise/*
cp -rfv /home/user/Documents/ExerciseShare/ExerciseFiles/Word/Advanced/ /home/tp3/Documents/Exercise/


I then saved the document, right-click > properties > permissions > execute as program



Bingo!



Thanks to all that helped!


[#32124] Monday, April 3, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
inaterested

Total Points: 500
Total Questions: 104
Total Answers: 92

Location: Virgin Islands (U.S.)
Member since Fri, May 7, 2021
3 Years ago
;