LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices



Reply
 
Search this Thread
Old 04-13-2012, 08:38 PM   #1
gaventar
LQ Newbie
 
Registered: Apr 2012
Posts: 2

Rep: Reputation: Disabled
Script for running a file via shortcut


I have a script I am running on my Redhat distro, This script I have to pull from a file as it runs multiple other systems together. The problem is I need to put these all on another computer and so people arent trying to run incorrect files I want to post a shortcut for the primary file on the desktop. (I am sorry if this is confusing). I am trying to write a quick bash script to locate the file and run it where it is located in /home/*user*/tec_connect. I know some basics but I need some help with the exact process since I havent done this in so long.

tl;dr Need help writing a bash script to run a shortcut to a file.
 
Old 04-13-2012, 09:52 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 328Reputation: 328Reputation: 328Reputation: 328
Just use the $USER environment variable. For example, /home/$USER/tec_connect. The variable is replaced with the current user account.
 
Old 04-14-2012, 02:00 AM   #3
gaventar
LQ Newbie
 
Registered: Apr 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thank you, that is what I was going to do, what I am needing is a basic script that I can run in terminal or have it auto run that will link to the file location. The equivalent of creating a shortcut in Windows on the desktop.
 
Old 04-14-2012, 02:11 AM   #4
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 328Reputation: 328Reputation: 328Reputation: 328
You just need to create a something.desktop file in '~/Desktop/' that looks like this:
Code:
[Desktop Entry]
Name=The name that appears to the user
Comment=The comment that appears on hover
Exec=theScript andParms
Icon=SomePngOrSvg
Type=Application
 
Old 04-14-2012, 02:27 AM   #5
yoK0
LQ Newbie
 
Registered: Apr 2012
Distribution: Slackware, CentOS
Posts: 29

Rep: Reputation: 0
ln -s - equivalent to Windows's shortcut

ln -s /home/user/tec_connect /home/user/Desktop/shortcut

man ln for more info
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Running a sed script on a text file.. ?? panda12 Linux - General 2 07-29-2009 11:13 PM
No Such File or Directory when running the script just_a_kid Linux - Newbie 7 01-25-2007 02:13 PM
Creating a desktop shortcut with a script file ben44b Linux - Newbie 5 01-07-2007 08:24 PM
Running a script on every file in a directory davee Linux - Newbie 2 11-04-2003 03:34 PM
Running a script file johnlb Linux - Newbie 2 02-19-2003 03:17 AM


All times are GMT -5. The time now is 05:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration