|
[Sponsors] |
May 1, 2013, 15:29 |
why not reading from script?
|
#1 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
I have put this script (plot)on my desktop as well as some other simple scripts and have given its address to bashrc as below:
Code:
PATH=$PATH:/home/ehsan/Desktop/codes Code:
ehsan@Ehsan-com:~/Desktop/WR_Main_Central$ plot rhoCentralFoam plot: rhoCentralFoam: No such file or directory plot: ignoring this file
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
May 2, 2013, 02:50 |
|
#2 |
Senior Member
Join Date: Dec 2011
Posts: 111
Rep Power: 19 |
Try to use the export command in .bashrc to make the variable global:
Code:
export PATH="$PATH:/home/ehsan/Desktop/codes" |
|
May 2, 2013, 05:54 |
|
#3 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
thanks.
but the error is repeated. Code:
ehsan@Ehsan-com:~/Desktop/WR_Main_Central$ plot rhoCentralFoam plot: rhoCentralFoam: No such file or directory plot: ignoring this file
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
May 2, 2013, 06:15 |
|
#4 |
Senior Member
Join Date: Dec 2011
Posts: 111
Rep Power: 19 |
In the top of your plot script, you have the shebang:
Code:
#! /bin/sh Code:
#!/bin/sh Code:
chmod +x plot |
|
May 2, 2013, 08:31 |
|
#5 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
I removed space.yes its executable.doesn't perform.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
May 2, 2013, 08:58 |
|
#6 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128 |
Greetings to all!
@Ehsan: What happens if you run the contents of the script directly on the command line? Namely: Code:
pyFoamPlotRunner.py --hardcopy --with-courant --progress --no-pickled-file rhoCentralFoam Bruno
__________________
|
|
May 2, 2013, 09:25 |
|
#7 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
dear Bruno I have been using that untill now and thought it will be better to do that by a short command and script but it doesn't work.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
May 2, 2013, 09:32 |
|
#8 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128 |
Quote:
Code:
#!/bin/sh Code:
#!/bin/bash Code:
#!/bin/bash which $1 Code:
which rhoCentralFoam
__________________
|
||
May 2, 2013, 10:15 |
|
#9 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
no.which command doesn't work in script but work in terminal:
Code:
ehsan@Ehsan-com:~/Desktop/WR_Main_Central$ plot rhoCentralFoam plot: rhoCentralFoam: No such file or directory plot: ignoring this file ehsan@Ehsan-com:~/Desktop/WR_Main_Central$ which rhoCentralFoam /opt/openfoam220/platforms/linux64GccDPOpt/bin/rhoCentralFoam
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
May 2, 2013, 10:25 |
|
#10 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128 |
I finally understand what's happening... try running:
Code:
which plot #or type plot The solution is simple: rename your "plot" script!
__________________
Last edited by wyldckat; May 2, 2013 at 10:26. Reason: added "type plot" |
|
May 2, 2013, 11:04 |
|
#11 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
yes that message was shown.then its name is like other script in ubuntu?
but other names don't work: Code:
ehsan@Ehsan-com:~/Desktop/WR_Main_Central$ do rhoCentralFoam bash: syntax error near unexpected token `do' ehsan@Ehsan-com:~/Desktop/WR_Main_Central$ runPlot rhoCentralFoam ehsan@Ehsan-com:~/Desktop/WR_Main_Central$
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
May 2, 2013, 11:37 |
|
#13 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
it knows the path:
Code:
ehsan@Ehsan-com:~/Desktop/WR_Main_Central$ which runPlot /home/ehsan/Desktop/codes/runPlot
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
May 2, 2013, 14:09 |
|
#14 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128 |
OK, then confirm the contents of the file... I don't know what it looks like at this point.
If it all makes sense, try changing the first line to this: Code:
#!/bin/bash -x
__________________
|
|
May 2, 2013, 14:25 |
|
#15 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
that says this:
Code:
ehsan@Ehsan-com:~/Desktop/WR_Main_Central$ runPlot rhoCentralFoam + solver=rhoCentralFoam + pyFoamPlotRunner.py --hardcopy --with-courant --progress --no-pickled-file rhoCentralFoam Killing PID 14778 PyFoam WARNING on line 232 of file /usr/local/lib/python2.7/dist-packages/PyFoam/Execution/FoamThread.py : Process 14778 was already dead Getting LinuxMem: [Errno 2] No such file or directory: '/proc/14778/status'
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
May 2, 2013, 14:44 |
|
#16 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26 |
resolved!
sorry,i had changed a postProceesing function meanwhile and didn't test full pyFoam command it terminal after that change. then it must have been resolved when I had changed its header to Code:
#!/bin/bash but i learned some more things! now a simple question how can I set number of processors in line like this: runPlot 4 rhoCentralFoam what should i replace for 4 in this code? : Code:
#!/bin/bash solver=$1 pyFoamPlotRunner.py --hardcopy --with-deltat --with-courant --procnr=4 $solver
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
May 2, 2013, 15:23 |
|
#17 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128 |
Quote:
Code:
#!/bin/bash solver=$2 pyFoamPlotRunner.py --hardcopy --with-deltat --with-courant --procnr=$1 $solver
__________________
|
||
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Commercial meshers] Mesh conversion problem (fluent3DMeshToFoam) | Aadhavan | OpenFOAM Meshing & Mesh Conversion | 2 | March 8, 2018 01:47 |
[Commercial meshers] Problem converting fluent mesh | vinz | OpenFOAM Meshing & Mesh Conversion | 28 | October 12, 2015 06:37 |
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem | Attesz | OpenFOAM Meshing & Mesh Conversion | 12 | May 2, 2013 10:52 |
Problem in running ICEM grid in Openfoam | Tarak | OpenFOAM | 6 | September 9, 2011 17:51 |
problem when converting mesh (made by ICEM) using fluentMeshToFoam | Forrest_Lei | OpenFOAM | 11 | October 16, 2009 06:28 |