LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-06-2018, 09:15 AM   #1
eco_bach
Member
 
Registered: Dec 2016
Posts: 242

Rep: Reputation: Disabled
Creating ALIAS - proper syntax


Hi

Can anyone tell me if the following syntax is correct? I'm prepending my PATH variable then launching houdini

Quote:
> alias houdini_run='pathold=$PATH; PATH=/home/jim/yt-conda/bin:/home/jim/yt-conda/sbin; /opt/hfs16.5.595/bin/hindie-bin; PATH=$pathold'
The problem is when I run it, houdini DOES launch but I'm seeing a lot of missing package errors even though they definitely ARE installed in the bin directory defined in the above PATH.

ie

Quote:
> sh: 1: grep: not found

> sh: 1: awk: not found

> sh: 1: ls: not found

Last edited by eco_bach; 10-06-2018 at 09:17 AM.
 
Old 10-06-2018, 09:30 AM   #2
lougavulin
Member
 
Registered: Jul 2018
Distribution: Slackware,x86_64,current
Posts: 279

Rep: Reputation: 100Reputation: 100
Why don't you add those directories to PATH with your user's .bashrc or .bash_profile ?

The errors are raised because you are removing all others directories from PATH. You need to ADD your directories to PATH.
Code:
PATH=$PATH:<add yours>
 
Old 10-06-2018, 09:38 AM   #3
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
The grep, awk and ls commands are system-wide commands that should already be in folders in the $PATH

The syntax for the alias command is quite simple.

Code:
alias <command_here>='<command and options for it here>'
For example if I wanted to run the ls command with the -la option every time I run ls, it would be the following;

Code:
alias ls='ls -la'
 
Old 10-07-2018, 12:58 AM   #4
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
You seem to have semicolons mixed in with the colons. I'm not sure what that alias is supposed to do.
 
Old 10-07-2018, 03:09 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
afaik, aliases don't do variables.
it would explain the problems your houdini causes, if it executes PATH=''.
i think you want a function in ~/.bashrc or a script in ~/bin.
 
Old 10-12-2018, 06:54 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
again?
or Still?

My detailed instructions were ineffective?
 
Old 10-12-2018, 07:57 PM   #7
eco_bach
Member
 
Registered: Dec 2016
Posts: 242

Original Poster
Rep: Reputation: Disabled
Op
Thanks for replies!
For reasons wont get into can't get to my linux machine for another week!
Will reply then.
 
Old 11-05-2018, 11:51 AM   #8
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
I'm inclined to follow the original thread for this "houdini who-dunnit"

Just sayin'
 
  


Reply



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
Proper syntax for ACLOCAL_FLAGS variable Kenny_Strawn Programming 7 10-15-2017 01:24 PM
[SOLVED] proper syntax for a qemu command jr_bob_dobbs Slackware 5 02-26-2016 09:22 PM
Proper Syntax for If...Then..Else statements with a script kaplan71 Linux - Software 2 11-11-2008 12:44 PM
proper syntax for 'more' command bourne Linux - General 6 09-14-2007 09:26 AM
Tar for backups ? Proper syntax ? Reefcrazed Linux - Newbie 8 02-21-2006 05:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:00 AM.

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
Open Source Consulting | Domain Registration