Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Unexpected command/filename substitution ( caused by alias?) Post 302773695 by phil518 on Thursday 28th of February 2013 01:59:01 PM
Old 02-28-2013
Thanks for all your responses.

I just found this detail info, which confirms your explanation:

". (source or dot operator)

If filename does not contain a slash, the PATH variable is used to find filename. The current directory is searched if filename is not found in $PATH. "
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

alias for rm command

Hi, i want to make alias for rm command. It should actually move the file to a directory in my home. Say if i type %rm abc.txt the command should expand to %mv abc.txt ~ashishp/trash How should I write the alias for this? -Ashish (8 Replies)
Discussion started by: shriashishpatil
8 Replies

2. UNIX for Dummies Questions & Answers

why emacs caused "command not found" error

I installed Red Hat Enterprise Linux 5 on my PC. When i typed 'emacs' on the console, "command not found" error occurrd. Why. :mad: (1 Reply)
Discussion started by: cy163
1 Replies

3. Shell Programming and Scripting

syntax error near unexpected token...what caused?

Dear all, When I tried to run receive.sh,it returned following errors. syntax error near unexpected token `do #!/usr/bin/ksh GlobalValueReceive=r GlobalValueWorking=w GlobalValueTemp=t $exec 0<Property while read LineInProperty do if then $GlobalValueReceive =... (8 Replies)
Discussion started by: joshuaduan
8 Replies

4. UNIX for Advanced & Expert Users

Alias a command

Hi 'm executing a java program from my shell script on solaris 9 as $JAVA_HOME\bin\java -ms32m -mx128m -classpath $CLASSPATH com.abc.fwk,abcServer.abcfwkServer $1 & where $1 is port number when i do ps -ef, it shows whole command , i want to give this some alias name as abcProcess, so... (2 Replies)
Discussion started by: b_garima
2 Replies

5. UNIX for Dummies Questions & Answers

Parameter substitution with alias

Hello, in my .bashrc I tried to setup some aliases. alias scp_cmd="scp -P 8888 $1 me@somehost:." is supposed to copy a local file to somehost via scp. However it seems that the command line substitution does not work here. However this works: alias lst="ls -l $1" The above scp command can... (1 Reply)
Discussion started by: strobotta
1 Replies

6. Shell Programming and Scripting

Substitution in a file dont work with an Array in filename

Hi. I´ve a script that should substitude the 8th line in a file called xxx.num6. The "xxx" is set by an array filled with this command: j=0 for Par in *.sys ; do Par=`echo $Par | sed 's/\(.*\).sys/\1/'` ; Par2="$Par" ; echo "${Par2}" j=$((j + 1)); done Now i try... (0 Replies)
Discussion started by: Lock3
0 Replies

7. UNIX for Dummies Questions & Answers

sed insert command and variable expansion/command substitution

I know this script is crummy, but I was just messing around.. how do I get sed's insert command to allow variable expansion to show the filename? #!/bin/bash filename=`echo $0` /usr/bin/sed '/#include/ { i\ the filename is `$filename` }' $1 exit 0 (8 Replies)
Discussion started by: glev2005
8 Replies

8. UNIX for Dummies Questions & Answers

the meaning of "!:*" in "alias foo 'command\!:*' filename"

Hi: How can I remove my own post? Thanks. (2 Replies)
Discussion started by: phil518
2 Replies

9. UNIX for Dummies Questions & Answers

read command - using output from command substitution

Hey, guys! Trying to research this is such a pain since the read command itself is a common word. Try searching "unix OR linux read command examples" or using the command substitution keyword. :eek: So, I wanted to use a command statement similar to the following. This is kinda taken... (2 Replies)
Discussion started by: ProGrammar
2 Replies

10. Shell Programming and Scripting

Alias command help

Hello, I'm attempting to configure shell settings in my new Macbook. The standard unix command line 'alias' doesn't seem to be working: bash-3.2$ alias dir ls -la bash: alias: dir: not found bash: alias: ls: not found bash: alias: -la: not found bash-3.2$ alias dir 'ls -la' bash:... (1 Reply)
Discussion started by: palex
1 Replies
test(1F)							   FMLI Commands							  test(1F)

NAME
test - condition evaluation command SYNOPSIS
test expression expression DESCRIPTION
test evaluates the expression expression and if its value is true, sets a 0 (TRUE) exit status; otherwise, a non-zero (FALSE) exit status is set; test also sets a non-zero exit status if there are no arguments. When permissions are tested, the effective user ID of the process is used. All operators, flags, and brackets (brackets used as shown in the second SYNOPSIS line) must be separate arguments to test. Normally these items are separated by spaces. USAGE
Primitives The following primitives are used to construct expression: -r filename True if filename exists and is readable. -w filename True if filename exists and is writable. -x filename True if filename exists and is executable. -f filename True if filename exists and is a regular file. -d filename True if filename exists and is a directory. -c filename True if filename exists and is a character special file. -b filename True if filename exists and is a block special file. -p filename True if filename exists and is a named pipe (FIFO). -u filename True if filename exists and its set-user-ID bit is set. -g filename True if filename exists and its set-group-ID bit is set. -k filename True if filename exists and its sticky bit is set. -s filename True if filename exists and has a size greater than 0. -t[fildes] True if the open file whose file descriptor number is fildes (1 by default) is associated with a terminal device. -z s1 True if the length of string s1 is 0. -n s1 True if the length of the string s1 is non-zero. s1 = s2 True if strings s1 and s2 are identical. s1 != s2 True if strings s1 and s2 are not identical. s1 True if s1 is not the null string. n1 -eq n2 True if the integers n1 and n2 are algebraically equal. Any of the comparisons -ne, -gt, -ge, -lt, and -le may be used in place of -eq. Operators These primaries may be combined with the following operators: ! Unary negation operator. -a Binary and operator. -o Binary or operator (-a has higher precedence than -o). `(expression)` Parentheses for grouping. Notice also that parentheses are meaningful to the shell and, therefore, must be quoted. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
find(1), sh(1), attributes(5) NOTES
If you test a file you own (the -r , -w , or -x tests), but the permission tested does not have the owner bit set, a non-zero (false) exit status will be returned even though the file may have the group or other bit set for that permission. The correct exit status will be set if you are super-user. The = and != operators have a higher precedence than the -r through -n operators, and = and != always expect arguments; therefore, = and != cannot be used with the -r through -n operators. If more than one argument follows the -r through -n operators, only the first argument is examined; the others are ignored, unless a -a or a -o is the second argument. SunOS 5.10 5 Jul 1990 test(1F)
All times are GMT -4. The time now is 03:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy