Search Results

Search: Posts Made By: era
1,418
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";...
209,864
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...
21,548
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...
174,656
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...
31,841
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,802
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,544
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?
28,113
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...
8,018
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,897
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

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