Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: era
1,299
Posted By era
It expands to the command-line parameters passed...
It expands to the command-line parameters passed to the script. However, it's wrong; it should be in double quotes, like "$@"

vnix$ cat >script
echo args: "$@"
for f in "$@"; do echo "arg: $f";...
172,377
Posted By era
The manual page for your shell documents these. ...
The manual page for your shell documents these.

$$ is the PID of the current process.

$? is the return code of the last executed command.

$# is the number of arguments in $*

$* is the...
17,118
Posted By era
ps -ef | grep identify | while read line; do ...
ps -ef | grep identify |
while read line; do
# for example, split on whitespace once we have one line
set -- $line
case $5 in 13:33) echo "$@";; esac # just as an example
done

You can...
171,647
Posted By era
Experiment to see. vnix$ n=1 vnix$ echo...
Experiment to see.

vnix$ n=1
vnix$ echo $($n)
bash: 1: command not found
vnix$ n="date"
vnix$ echo $($n)
Wed May 21 20:39:00 EEST 2008

So it uses the value of $n as a command. (It's the...
30,356
Posted By era
The ^M is a DOS carriage return. Use a tool like...
The ^M is a DOS carriage return. Use a tool like unix2dos to clean out any DOS line endings from the script file.
5,397
Posted By era
var=${var}morestuff Maybe you even want a...
var=${var}morestuff

Maybe you even want a newline between the old value and morestuff?

var=${var}'
'morestuff

That looks weird but it works.
11,222
Posted By era
And apart from the fact that you need to double...
And apart from the fact that you need to double the equals sign in the condition, does it work?
27,027
Posted By era
And the backticks don't fit that definition? ...
And the backticks don't fit that definition?

Anything you can do in a script, you can do on the command line, anyway.

For the general solution, xargs is probably closest to what you have in...
7,701
Posted By era
Probably it does, but there are many...
Probably it does, but there are many implementations, so if it is undocumented, you will have to experiment, or look at the source.

rexec is insecure and should be replaced by ssh if at all...
2,570
Posted By era
Or even just run the command once. perms=`ls...
Or even just run the command once.

perms=`ls -l "$1" | cut -f1`
case $perms in
?r?????????) echo Read for owner;;
esac
case $perms in
??w???????) echo Write for owner;;
esac

etcetera. ...
Showing results 1 to 10 of 10

 

Featured Tech Videos

All times are GMT -4. The time now is 04:09 AM.
Unix & Linux Forums Content Copyright 1993-2021. All Rights Reserved.
Privacy Policy