Sponsored Content
Top Forums Shell Programming and Scripting calling awk from php not working Post 302591460 by mary271 on Thursday 19th of January 2012 02:00:13 PM
Old 01-19-2012
Thanks for reply.

I wrote a php code that creates the following command:

join -t$'\t' -a1 -a2 -e- -j1 -o0,1.2,2.2 <(awk -f agg.awk fff1.txt) <(awk -f agg.awk fff2.txt) |
join -t$'\t' -a1 -a2 -e- -j1 -o0,1.2,1.3,2.2 - <(awk -f agg.awk fff3.txt) |
join -t$'\t' -a1 -a2 -e- -j1 -o0,1.2,1.3,1.4,2.2 - <(awk -f agg.awk fff4.txt) |
join -t$'\t' -a1 -a2 -e- -j1 -o0,1.2,1.3,1.4,1.5,2.2 - <(awk -f agg.awk fff4.txt) |
join -t$'\t' -a1 -a2 -e- -j1 -o0,1.2,1.3,1.4,1.5,1.6,2.2 - <(awk -f agg.awk fff6.txt) > tmp.txt

My only concern now is why it does not work if I call from php.

My php file is:

PHP Code:
<?php
$command 
="awk -f onecol.awk f1.txt > outfirst.txt";
system($command);

$command ="join -t$'\\t' -a1 -a2 -e- -j1 -o0,1.2,2.2 <(awk -f agg.awk fff1.txt)     <(awk -f agg.awk fff2.txt)  >  outsecond.txt ";
system($command);
?>
Thanks

Last edited by mary271; 01-19-2012 at 03:19 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Calling a PHP script from cron

This is a line from my crontab: 12 12 * * * /home/users/ElburdNDL/www/backups/adddate.php The permissions of the script is 755 it should execute ok....but it doesn't. Do I somehow have to give cron the path to PHP or something? If so, how exactly? Thanks. Ed PS Am a total newbie... (10 Replies)
Discussion started by: eludlow
10 Replies

2. UNIX for Dummies Questions & Answers

calling mkdir from PHP

Edit: From a post in this topic, found out that my problem wasn't what I thought it was, and ended up solving my problem in aonther topic: https://www.unix.com/showthread.php?p=302076761#post302076761 Hi, I'm not sure if this is a Unix problem or a PHP problem, but I'll see if anyone here... (4 Replies)
Discussion started by: gmclean2006
4 Replies

3. Shell Programming and Scripting

calling current working dir from script

Hello, I am having problem in setting current working directory from shell. I want to set pwd as an environmental variable in a script. I am following an existing script which is defined as HOME=$(shell dirname `pwd`) C_HOME=$(shell echo $(HOME) | sed -e 's:\/:\\\/:g' ) But when I am trying... (3 Replies)
Discussion started by: chandra004
3 Replies

4. Shell Programming and Scripting

Calling a shell script from php

Hi, I have a shell script and I'm trying to execute it from my php script. The command I'm using is: shell_exec("Script.sh"); Is this correct? It seems to not do anything for me. Not sure if this might be a permission issue or not. I have both scripts 777 permissions. Maybe I got the... (1 Reply)
Discussion started by: eltinator
1 Replies

5. Shell Programming and Scripting

Calling an Expect script from a Webpage using PHP

I have a webpage that is in HTML and PHP. In PHP I have tried using exec, system, shell_exec and passthru functions to call an Expect Script file (temp.exp). This Expect file spawns a telnet session that uses "expect/send" commands to retrieve information from an environmental unit (not a normal... (0 Replies)
Discussion started by: CCUSmith
0 Replies

6. Shell Programming and Scripting

Calling php from shell script

Maybe someone here can help out. I have a script cat <somefile> | while read hostname do /usr/bin/php <some php script> $hostname done This script works great for the first entry in the host list. However it will only execute and ignores the loop part. It's almost as if it loses... (4 Replies)
Discussion started by: dbakyle
4 Replies

7. Shell Programming and Scripting

ssh is not working while calling through expect shell script

Hi, Please share you experience and way out on below error:--> #!/bin/bash -xv FILE=login.txt + FILE=login.txt CONNECT=sshlogin.exp + CONNECT=sshlogin.exp SERVERNAME=$1 + SERVERNAME=192.168.12.1 MyServer="" + MyServer= MyUser="" + MyUser= MyPassword="" + MyPassword= exec 3<&0 +... (6 Replies)
Discussion started by: manish_1678
6 Replies

8. Programming

Calling macro in shell_exec not working

Hi guys! I really need your help. I have a php code that should convert doc, ppt,etc. to pdf using openoffice. But its not working, and im not sure what the problem is. Here's my php code: define('OOFFICE_LIBRARY', '/usr/lib/openoffice.org/program/'); $convertToPdf = OOFFICE_LIBRARY .... (5 Replies)
Discussion started by: tweine
5 Replies

9. UNIX for Advanced & Expert Users

Awk expressions working & not working

Hi, Putting across a few awk expressions. Apart from the last, all of them are working. echo a/b/c | awk -F'/b/c$' '{print $1}' a echo a/b/c++ | awk -F'/b/c++' '{print $1}' a echo a/b/c++ | awk -F'/b/c++$' '{print $1}' a/b/c++ Request thoughts on why putting a '$' post double ++... (12 Replies)
Discussion started by: vibhor_agarwali
12 Replies

10. Shell Programming and Scripting

PHP cronjob not working but manual working

Hi, Can anyone help me on my PHP cron not working, but when i do the manual it work. # manual run working /usr/local/bin/php /root/dev/test.php # crontab not working 55 8 * * * /usr/local/bin/php /root/dev/test.php Thank in advances Regards, FSPalero Please use CODE tags as... (2 Replies)
Discussion started by: fspalero
2 Replies
RESOURCEBUNDLE_LOCALES(3)						 1						 RESOURCEBUNDLE_LOCALES(3)

ResourceBundle::getLocales - Get supported locales

	Object oriented style

SYNOPSIS
public array ResourceBundle::getLocales (string $bundlename) DESCRIPTION
Procedural style array resourcebundle_locales (string $bundlename) Get available locales from ResourceBundle name. PARAMETERS
o $bundlename - Path of ResourceBundle for which to get available locales, or empty string for default locales list. RETURN VALUES
Returns the list of locales supported by the bundle. EXAMPLES
Example #1 resourcebundle_locales(3) example <?php $bundle = "/user/share/data/myapp"; echo join(PHP_EOL, resourcebundle_locales($bundle)); ?> The above example will output something similar to: es root Example #2 OO example <?php $bundle = "/usr/share/data/myapp"; $r = new ResourceBundle( 'es', $bundle); echo join(" ", $r->getLocales($bundle)); ?> The above example will output something similar to: es root SEE ALSO
resourcebundle_get(3). PHP Documentation Group RESOURCEBUNDLE_LOCALES(3)
All times are GMT -4. The time now is 01:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy