Programming :: Alias And Shopt Won't Work In Script
Jul 6, 2011alias and shopt won't work in script
[Code]....
alias and shopt won't work in script
[Code]....
I'm trying to set up 2 aliases with PHP files in it. But in both cases I get a 403 Forbidden error. This is what the /etc/apache2/conf.d/alias file looks like:
[Code]....
I have problem to use an alias that defined in ksh93 script,in the functions in the same script onm Linux.I definied an alias in main: alias echo='echo -e' in order that echo will read backslashes but when i executed it in function, the alias didnt work, and performewd a regular echo, without -e
cat test.ksh
#!/bin/ksh
alias echo='echo -e'
checkUsage
[code]....
I want to create an alias or function that when used prints something like this on the command line so I can further modify it before pressing enter myself.
Code:
$ FILE=exercise1; cc -o $FILE $FILE.c && ./$FILE; FILE=
The idea is that I'm studying c and want to change the name of the file once instead of
[code]....
I am trying to execute executable files in bash without adding ./ I know there must be an alias to add in .bashrc, that must be something like alias PATH=$PATH:. But this seems not to be working.
View 1 Replies View RelatedOkay so I have an alias that looks like this:
Code:
ALIAS sorigin {
MSG sorigin Test1
[code]...
i want to add few arguments at alias
Example:
alias GGG 'bla bla bla ARG1 ARG2 bla bla bla bla ARG3 ARG4 bla bla'
> GGG ARG1 ARG2 ARG3 ARG4
I am going through and old .cshrc file and it contains the following alias:
alias pwd 'echo $cwd'
I used to think that this is how pwd might have been implemented. But looks like thats not the case (because then this alias is meaningless).
I was trying to add new alias "alias ls='ls --color=auto'" in .profile, but it never worked I displayed all the alias that are current available and did not see the one I just added and found this among them:
lsls $LS_OPTIONS
and the LS_OPTIONS is "-N --color=none -T 0"
this is in /etc/csh.cshrc file which I do not have permission to edit.
Is there way to overwrite it?
Also I do not see a .cshrc under my home directory. Can I just make one and source it? Or do I have to link it to some source file that already exists?
I have to move our DNS server to our VMware environment. With that comes a new IP address (10.10.102.x). The current address is in the 192.168.10.x. range. Is there a way to bind an alias to my NIC that has a different IP range? I tried it and it didnt work but if i used two IPs in the same subnet range it works. What are my options?
I don't want to go around and modify all my clients to use the new IP. I have many other things running like Nagios and Puppet. Unfortunately this is going to suck and I probably dont have any other options.
I know I can rename my network interfaces (eg 'eth0' to 'lan', 'eth1' to 'net' etc) but does anyone know a way I can alias (symlink if you like) 'lan' -> 'eth0'
I want to be able to use more legible interface names in things like iptables rules (such as "-i lan" instead of "-i eth0") but I don't want to break any config that is expecting eth0 to exist....
I'm running ubuntu 9.04 and I have set up 2 ip aliases using the /etc/network/interfaces file http://pastie.org/775037 -- when I ping the main address 10.0.2.16, all works fine, same with the first alias 10.0.2.22 -- but I can't reach the 2nd alias 10.0.2.23 I get the following from ping:
PING 10.0.2.23 (10.0.2.23): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
92 bytes from 10.5.0.1: Destination Host Unreachable
Vr HL TOS Len ID Flg off TTL Pro cks Src Dst
4 5 00 5400 06eb 0 0000 3f 01 5e81 10.5.0.34 10.0.2.23
My machine's IP address is 10.5.0.34 I can't figure out why I can ping 10.0.2.22 but not 10.0.2.23 -- seems like there is probably some kind of routing thing that I'm missing, but I'm confused how it would have gotten set up for 10.0.2.22 but not 10.0.2.23 -- hopefully someone out there has an idea -- or can point me to references where I might be able to learn how to debug routing issues on a network?
I would like to use something like a 'cdl' alias that would cd into the directory i choose and then ls the contents automatically. I find myself using ls after i cd into a directory all the time. Something like:
alias='cdl=cd $1;ls'
usage: cdl /local/dir
I'm testing out the aliases to have a better understanding on how to shorten commands. I am trying to list all files whose file names end with a .c extension in which starts from the current working directory and recursing through subdirectories as well. And I want to delay the path name expansion until the alias is executed. I want to use the directory /usr/share. Would the command be: alias findc='find -type d -exec /usr/share'?
View 3 Replies View Relatedi have to set up a alias like:alias ll='ls -l'them ll will work
View 2 Replies View RelatedIs there anyway you can configure either OpenVPN client or the system to allow connections using OpenVPN to be made to computers on the OpenVPN network using their alias rather than their IP address. This may sound blasphemous but you can in Windows. That is if the VPN network is say 10.x.0.x I could connect to Comp4 or Comp2 using Comp4 or Comp2 not 10.x.0. 4 or 10.x.0.2 or whatever IP is allocated by the OpenVPN server. If the OpenVPN server has not been restarted then it will usually allocate the same IP every time the same client connects.
View 8 Replies View RelatedI have an alias that I would like to use both as a regular user and as root, via sudo. Specifically, it is this:
alias rm=trash This works fine as a normal user, and it works fine when I use sudo -i to get a root shell prompt, but if I use sudo rm, the alias does not apply. So where do I need to put my alias so that it works in one-off sudo commands?
My current alias'd commands are:
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias ls='ls --color=auto'
I'd like to change 'ls' and add a few more, is there a command to permanently do that, or a config file I need to edit somewhere?
Is there anyway we can add a local domain alias so that if we enter [url] in the browser it would point to [url]
In Windows XP I used to do it by editing the "hosts" file from the following directory
Code:
Code:
How do we do the same thing on Ubuntu 9.04?
I set up a mailserver using this tutorial:[URL].. It works fine so far. I run this server for a small company with about 20 mailboxes where a address looks like that.[URL].. Now I want to set up an alias domain so that [URL].. also automatically is directed into the mailbox of "user".
View 1 Replies View RelatedCan anybody explain how I can set a hostname alias in RHEL5. We are testing RHEL to replace our Solaris LDAP servers, one of the things we need is to be able to set a hostname alias on the public interface.In solaris we can just update the /etc/hosts file to something like
ipaddress hostname alias1 alias2
Things looks alittle different in RHEL, the host file only contains
127.0.0.1 hostname.fqdn localhost.localdomain localhost
I read about the sysconfig/network files but can only see about changing the hostname there and nothing about setting a different alias.
I have a script that I run using ./dom example.com.
I want to add an alias to .bashrc so that I can run it using "d example.com".
I have tried adding each of the lines below in turn but I still receive the error:
-bash: d: command not found
alias d="/bin/bash /home/user/dom"
alias d="./home/user/dom"
alias d="sh /home/user/dom"
I'm running Utorrent server and I figure I would create an alias to launch the program and run it in the background.alias utorrent='/home/user1/software/utorrent-server-3.0/utserver &'It seems to run the program but the associated webui program is flaky and won't start correctly.If I manually go to the specified path and run the command ./utserver & , I never seem to have an issue with the webui.I was wondering if this could possibly have anything to do with using the '&' ampersand operator in an alias.
View 2 Replies View Relatedhow to save alias permanent
View 4 Replies View RelatedI tried this to set an alias: alias lsf='ls -f' and it works fine... But when I put it in a bash script it doesnt work. SCRIPT:
cd ~
alias lsf='ls -F'
lsf
I get the following output: line 3: lsf: command not found
I used the alias command to make ll be ll -lrt. I have linux 5 and using the bash shell. now I can't even use ll, only ls. when I go into the bin directory, ll is not in the list and the normal color codes for bash are not showing either...folders blue, etc
View 4 Replies View RelatedHow to set global alias for all user
View 3 Replies View RelatedI have searched the forum high and low for the solution with no success, so I will now post this problem, with all known facts. Linux (and Fedora) is brand new to me so I'm somewhat illiterate with the language and recommendations from reading other threads. Please bare with me. I'm reading the book Beginning PHP and MySQL from Novice to Professional by Cristian Darie.The book has you create an Alias directory for creating the tshirtshop web-based application.
The book uses the directory /home/username/tshirtshop. However, I did not want this in the /home directory, so I created a new directory from the root directory /workspace/tshirtshop. Below are the areas of interest in the file httpd.conf (I restarted the httpd service each time I edited this file):
Code:
DocumentRoot "/var/www/html"
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
[Code]....
I need to occasionally touch a file with the current timestamp as the filename. I would do so this way:
touch `date "+%Y-%m-%d_%H-%M"`.txt
However, I'd like to define an alias for this. When I try adding to the bashrc this:
alias td="touch `date "+%Y-%m-%d_%H-%M"`.txt"
the result is that the filename is the same during the entire session, since the `date ..` gets calculated just once during login...
How can I get the command to expand only when I call the alias? Or must I use a function for this?
In my laptop, if I type below
$ which vi
alias vi='vim'
/usr/bin/vim
Now I want to change the vi alias to another bin, e.g. vim_wrapper a script created in /usr/bin/, I type this line:
alias vi="vim_wrapper"
in ~/.bashrc or /etc/bashrc, but take no effects. So How to change the default vi alias vi='vim' to vi='vim_wrapper'?