10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I ran into the following and still do not understand entirely the rationale behind this. If someone could explain why things are as they are I'd be thankful.
The following was tested on AIX 7.1 with ksh88, but i suspect that to be ubiquitous. In an installation routine i had to create a set of... (6 Replies)
Discussion started by: bakunin
6 Replies
2. Shell Programming and Scripting
Hi,
I have prepared a script and trying to execute it but not getting expected output. Could you please help and advise what is going wrong.
"If else" part in below script is not working basically.
I am running it on HP-UX.
for i in slpd puma sfmdb
do
echo "******\t$i\t*******"
echo... (10 Replies)
Discussion started by: sv0081493
10 Replies
3. UNIX for Dummies Questions & Answers
Hi. I am trying to start a script on my router that will execute even if i log off. To execute the script I write:
nohup ./dslconnection > dslstat.out 2>&1 &
It starts the job:
21968 admin 1604 S /bin/ash ./dslconnection
The problem is that when I log back in the job has been... (6 Replies)
Discussion started by: sebcou
6 Replies
4. UNIX for Dummies Questions & Answers
I need to sort through a volume that contains video files by access time and delete files that have not been accessed over x days. I have to use the access time as video files are originals that do not get modified, just read
Testing commands on a local test folder...
$ date
Wed Sep 28... (10 Replies)
Discussion started by: canon273
10 Replies
5. Shell Programming and Scripting
total=0
seq 1 5 | while read i ; do
total=$(($total+$i))
echo $total
done
echo $totalThis outputs:
1
3
6
10
15
0whereas I am expecting:
1
3
6
10
15
15My bash version: (4 Replies)
Discussion started by: meharo
4 Replies
6. OS X (Apple)
I've been trying to figure this out since last night, and I'm just stumped. The last time I did any shell scripting was 8 years ago on a Unix box, and it was never my strong suit. I'm on a Mac running Leopard now. Here's my dilemma - hopefully someone can point me in the right direction.
I'm... (10 Replies)
Discussion started by: Daniel M. Clark
10 Replies
7. UNIX for Dummies Questions & Answers
Portion of my script below :
if ; then
NUMBEROFFEILDS=`cat ${BASE_SCRIPT_LOC}/standardfilecleanup.lst|grep -w ${db_file_path}|awk -F: '{print NF}'`
COUNT=4
while ; do
awk_var="$"`echo $COUNT`
file_name1=`cat ${BASE_SCRIPT_LOC}/standardfilecleanup.lst|grep -w... (1 Reply)
Discussion started by: findprakash
1 Replies
8. UNIX for Dummies Questions & Answers
I have a script with a find command using xargs to copy the files found to another directory. The find command is finding the appropriate file, but it's not copying. I've checked permissions, and those are all O.K., so I'm not sure what I'm missing. Any help is greatly appreciated.
This is... (2 Replies)
Discussion started by: mpflug
2 Replies
9. Shell Programming and Scripting
Hi,
I use the command
ls a\b\c\*.txt
from the command line on HP UNIX and it works fine - It lists all files matching *.txt in the a\b\c directory
When embeded in a ksh script
`ls a\b\c\*.txt`
it does not work - I get *.txt not found (even though there are files)
I tried... (10 Replies)
Discussion started by: GNMIKE
10 Replies
10. Shell Programming and Scripting
Hello.
Consider the following magic words:
# ls `which adduser`
ls: /usr/sbin/adduser: No such file or directory
#
Hmmm...
Then:
# ls /usr/sbin/adduser
/usr/sbin/adduser
#
Now what?
Unforunately this little sniippet is used in my debian woody server's mysql pre install script.... (2 Replies)
Discussion started by: osee
2 Replies
ECHO(3) 1 ECHO(3)
echo - Output one or more strings
SYNOPSIS
void echo (string $arg1, [string $...])
DESCRIPTION
Outputs all parameters.
echo is not actually a function (it is a language construct), so you are not required to use parentheses with it. echo (unlike some other
language constructs) does not behave like a function, so it cannot always be used in the context of a function. Additionally, if you want
to pass more than one parameter to echo, the parameters must not be enclosed within parentheses.
echo also has a shortcut syntax, where you can immediately follow the opening tag with an equals sign. Prior to PHP 5.4.0, this short syn-
tax only works with the short_open_tag configuration setting enabled.
I have <?=$foo?> foo.
PARAMETERS
o $arg1
- The parameter to output.
o $...
-
RETURN VALUES
No value is returned.
EXAMPLES
Example #1
echo examples
<?php
echo "Hello World";
echo "This spans
multiple lines. The newlines will be
output as well";
echo "This spans
multiple lines. The newlines will be
output as well.";
echo "Escaping characters is done "Like this".";
// You can use variables inside of an echo statement
$foo = "foobar";
$bar = "barbaz";
echo "foo is $foo"; // foo is foobar
// You can also use arrays
$baz = array("value" => "foo");
echo "this is {$baz['value']} !"; // this is foo !
// Using single quotes will print the variable name, not the value
echo 'foo is $foo'; // foo is $foo
// If you are not using any other characters, you can just echo variables
echo $foo; // foobar
echo $foo,$bar; // foobarbarbaz
// Some people prefer passing multiple parameters to echo over concatenation.
echo 'This ', 'string ', 'was ', 'made ', 'with multiple parameters.', chr(10);
echo 'This ' . 'string ' . 'was ' . 'made ' . 'with concatenation.' . "
";
echo <<<END
This uses the "here document" syntax to output
multiple lines with $variable interpolation. Note
that the here document terminator must appear on a
line with just a semicolon. no extra whitespace!
END;
// Because echo does not behave like a function, the following code is invalid.
($some_var) ? echo 'true' : echo 'false';
// However, the following examples will work:
($some_var) ? print 'true' : print 'false'; // print is also a construct, but
// it behaves like a function, so
// it may be used in this context.
echo $some_var ? 'true': 'false'; // changing the statement around
?>
NOTES
Note
Because this is a language construct and not a function, it cannot be called using variable functions.
SEE ALSO
print(3), printf(3), flush(3), Heredoc syntax.
PHP Documentation Group ECHO(3)