2 tidyup formatting
source | link

I am trying to display a message when I log on to Linux Mint 17.2Linux Mint 17.2. I have tried various methods without success:

1) I created a file "/home/myusername/Desktop/startup-message.sh"/home/myusername/Desktop/startup-message.sh as follows:

#!/bin/bash

echo "My startup message"

pause

exit

#!/bin/bash
echo "My startup message"
pause
exit

I made the file executable and made sure it works from a command line, e.g.

bash "/home/myusername/Desktop/startup-message.sh"

bash "/home/myusername/Desktop/startup-message.sh"

or sh -c "/home/myusername/Desktop/startup-message.sh"

sh -c "/home/myusername/Desktop/startup-message.sh"

Then I used Mint's 'Startup Application' feature and added a new entry. I tried:

  "/home/myusername/Desktop/startup-message.sh"
 
  bash "/home/myusername/Desktop/startup-message.sh"
 
  sh -c "/home/myusername/Desktop/startup-message.sh"

with and without quotes around the path name. In all cases, nothing was displayed and the "pause" was ignored.

Finally, I added a command to copy a file after the pause, and the file was copied. So, it appears that "echo"echo and "pause"pause are ignored in a start-up file, presumably because no terminal is open?

2) I then tried adding the message to /etc/profile/etc/profile, but the message didn't appear when I logged on.

3) I then tried adding the message to /etc/motd/etc/motd, but the message didn't appear when I logged on.

So how can I perform this simple task?

I am trying to display a message when I log on to Linux Mint 17.2. I have tried various methods without success:

1) I created a file "/home/myusername/Desktop/startup-message.sh" as follows:

#!/bin/bash

echo "My startup message"

pause

exit

I made the file executable and made sure it works from a command line, e.g.

bash "/home/myusername/Desktop/startup-message.sh"

or sh -c "/home/myusername/Desktop/startup-message.sh"

Then I used Mint's 'Startup Application' feature and added a new entry. I tried:

  "/home/myusername/Desktop/startup-message.sh"
 
  bash "/home/myusername/Desktop/startup-message.sh"
 
  sh -c "/home/myusername/Desktop/startup-message.sh"

with and without quotes around the path name. In all cases, nothing was displayed and the "pause" was ignored.

Finally, I added a command to copy a file after the pause, and the file was copied. So, it appears that "echo" and "pause" are ignored in a start-up file, presumably because no terminal is open?

2) I then tried adding the message to /etc/profile, but the message didn't appear when I logged on.

3) I then tried adding the message to /etc/motd, but the message didn't appear when I logged on.

So how can I perform this simple task?

I am trying to display a message when I log on to Linux Mint 17.2. I have tried various methods without success:

1) I created a file /home/myusername/Desktop/startup-message.sh as follows:

#!/bin/bash
echo "My startup message"
pause
exit

I made the file executable and made sure it works from a command line, e.g.

bash "/home/myusername/Desktop/startup-message.sh"

or

sh -c "/home/myusername/Desktop/startup-message.sh"

Then I used Mint's 'Startup Application' feature and added a new entry. I tried:

  "/home/myusername/Desktop/startup-message.sh"
  bash "/home/myusername/Desktop/startup-message.sh"
  sh -c "/home/myusername/Desktop/startup-message.sh"

with and without quotes around the path name. In all cases, nothing was displayed and the "pause" was ignored.

Finally, I added a command to copy a file after the pause, and the file was copied. So, it appears that echo and pause are ignored in a start-up file, presumably because no terminal is open?

2) I then tried adding the message to /etc/profile, but the message didn't appear when I logged on.

3) I then tried adding the message to /etc/motd, but the message didn't appear when I logged on.

So how can I perform this simple task?

1
source | link

How do I display a message when I logon?

I am trying to display a message when I log on to Linux Mint 17.2. I have tried various methods without success:

1) I created a file "/home/myusername/Desktop/startup-message.sh" as follows:

#!/bin/bash

echo "My startup message"

pause

exit

I made the file executable and made sure it works from a command line, e.g.

bash "/home/myusername/Desktop/startup-message.sh"

or sh -c "/home/myusername/Desktop/startup-message.sh"

Then I used Mint's 'Startup Application' feature and added a new entry. I tried:

  "/home/myusername/Desktop/startup-message.sh"

  bash "/home/myusername/Desktop/startup-message.sh"

  sh -c "/home/myusername/Desktop/startup-message.sh"

with and without quotes around the path name. In all cases, nothing was displayed and the "pause" was ignored.

Finally, I added a command to copy a file after the pause, and the file was copied. So, it appears that "echo" and "pause" are ignored in a start-up file, presumably because no terminal is open?

2) I then tried adding the message to /etc/profile, but the message didn't appear when I logged on.

3) I then tried adding the message to /etc/motd, but the message didn't appear when I logged on.

So how can I perform this simple task?