I am bussy with a litle bash script but i have now a problem.I have a file on the server with every time different text.Somewere in this text the is the following line:PHP Code:<BR><DIV CLASS='itemTotalsTitle'>2 Matching Service Entries Displayed</DIV> I want to make a bash script that replace this line when it says:"0 Matching Service Entries Displayed"To a other text like:"There a no knowing problem(s) on this moment."]If there is a other number than "0" than replace this line with:2 problems have been found on this moment, whe are bussy to fix this problem
I am new to both linux and fortran programming. I am trying to read from an external file, but it gives this error message: Fortran runtime error: Bad integer for item 1 in list input Part of the code that has the problem is:
All the variables have been declared before and there is no problem with that. The problem (error message) is in the (first) line that deals with open(unit=3,file='..//').
I am trying to install the Matlab 7.5 compiled runtime for 64-bit Linux (MCRInstaller.75.glnxa64.bin) and keep getting a "No Java Runtime Environment(JRE) was found on this system." error message.
I understand the JRE is bundled with MCRInstaller and will self-compile/install. However, I don't have admin access, could this be the source of the problem? If so, how could I fix it (not sure how to direct it to install locally without going into the source code)?
I got around this error before, but stupid me didn't write down what I did and I forgot.
I know there is a way to call winapi in runtime in windows. I want to ask how can I call a system call in gcc in runtime (when I don't know what it can be)? I don't mean syscall that I think is for calling only system calls and not library functions.
I'm writing an application with a plugin architecture and would like modify (specifically add to) the dynamic library search path while the main executable is running.
The plugin paths are not known until the application is running so I can't set LD_LIBRARY_PATH ahead of time.
My understanding (although I haven't tested it) is that the executable will only parse the LD_LIBRARY_PATH once, early on, so modifying this environment variable at runtime will have no effect.
(Note - on Windows the solution is to modify the PATH environment variable)
I know it's possible to specify the full path to load a dynamic library, and this would work if the plugin(s) only had a single library to load, but some of them will have a bunch of libraries with their own inter-dependencies, so I'd like the plugin folder(s) to get added to the search path to pick up the dependant libs.
I'm new to the linux world and its been quit sometime since i've done any programming. However, I'm writing a program which simply calculates the load average of a process. In doing this I need to use the uptime command for linux in a java program. I've done a little bit of searching on the net and it mentions this is possiable by using java runtime command. Unfortunatly though I have yet to find a working example of this. I've tried just simply reading the /proc/uptime file but I have no clue how to format the 2 numbers in seconds to make it the same as if you just typed in uptime in the linux command prompt.
After installing Fedora 14 and being satisfied with the behaviour and the packages installed for it, i want to replicate the same installation in a few more PCs, so i installed Revisor to make with it an iso file that reflects my actual installation.
The problem is that if i run the software from Applications->System tools->Revisor, nothing happens after giving the user password.
Then i run it from a consele and this error is produced after giving my password: "Cannot find anaconda-runtime in /usr/lib/anaconda-runtime"
But anaconda is the environment used for installation, so it is installed from the very begining. Why this happens?
I would like to know how do I print the line # in a script. My requirement is, I have a script which is about ~5000 lines long. If there are any errors happen I just exit. And I would like to add the line # of the script where the error happened.
Code: #!/bin/bash trap "echo 'you got me'" SIGINT SIGTERM # to trap ctrl+c echo "Press ctrl+c during 5 sec loop" for ((i=0;i<5;i++)); do
[Code]...
How come code behaves normally and stops when ctrl+c signal is caught and resumes, but after I use at least one timeout read in the code it looks like, if signal is caught again it doesn't pause the execution but skips the loop. If you remove -t (timeout) option from the read, both loops look the same!
Now in my bash script, I want to get the output /home/user instead of $HOME once read. So far, I have managed to get the $HOME variable but I can't get it to echo the variable. All I get is the output $HOME.
I have written quite a few separate bash & scripts and php scripts that up to now I have run from cron jobs. However I have to estimate how long each takes to run, before running the next and so it probably takes much longer than necessary to run them all. They have to run in order.
Now there are so many I am thinking it would be better to have a master bash script that would run one after the other, but I am not sure how to get the master script to wait before starting to run the next script. Is this possible and is there a command that will make the script wait between bash and php scripts , for them to finish, before running the next?
I think it would be better to count the len and remove 3 chars to right to get the extension, but it can be macintosh filenames with have 4 chars for extensions.
I simply want to read a file "data.txt" line by line Then char by char and add them into a result var. The file is supossed to always contain numeric values
where a client need to login to server after a connection has been established if login is not sucessfull connection should be terminated I need it in c language
server asks client name and password if authenticated , a connection is established . and if client is new can also register its name
I have done it using files but its not working when asks for user name it searches a file with that username if a file is found and password with same as username it opens the username file check for the string if it matches with the string login is ok
I installed Fedora 11, but i can't do programing teh fedora seems not to include anything IDE for free like previous version
I can not search on installed desktop what software were included it asks me to connect to the Internet to view the installers and install new things I'd also like to compile latex to have a Qt IDE installed but none are there for me
I am facing problem with the following script. Could you please look into this.echo 'Enter Staging number' case $STGNUM in
1) for i in {'stg1-greg','stg1-marsha','stg1-peter','stg1-jan','stg2-greg','stg2-marsha','stg2-peter','stg2-jan'};do echo $i; ssh $i sudo -u dev /opt/usr/apps/workflow/stopwf.sh;done;
The first is Mp3 which is no problem for Ubuntu. The second is WMP, also no problem. The third format is WMA, which uses an Overdrive Media Console designed to run in Windows. This has stumped me. I was hoping to run it in Wine, but the media console refuses to download into Ubuntu. Then I tried downloading the audio file straight into Ubuntu. What I get is a text file in some programing language, parts of which are in readable english describing the book and lines of code refering actual audio files(HTML tags?).So Can anybody tell me how to play WMA audio books in Ubuntu. The rest of the media is installed and works perfectly.
I was messing around trying to be able to download minecraft to my computer (it's very confusing for Linux, and I know nothing about this system!) Now when I try to install apps in the Software Center I get this error: There seems to be a programming error in aptdaemon, the software that allows you to install/remove software and to perform other package management related tasks.
Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/aptdaemon/worker.py", line 961, in simulate trans.unauthenticated = self._simulate_helper(trans) File "/usr/lib/python2.7/dist-packages/aptdaemon/worker.py", line 1085, in _simulate_helper return depends, self._cache.required_download, File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 226, in required_download pm.get_archives(fetcher, self._list, self._records) SystemError: E:I wasn't able to locate file for the sun-java6-jre package. This might mean you need to manually fix this package.
I've seen a solution that seemed to work for someone else but when I go into the Terminal and type in the commands it asks for my sudo password and I have no idea what that means/is because I never set any kind of password like that.
I need to rename the resulted searched files from a loopI have the following code:
find . -name DOC* | while read i do find $i -type f -name '*.txt' done
basically, I am searching for all txt files inside any folder starting with DOC name.this code is working fine with me.I need to rename those .txt files to .txtOLDOS: Ubuntu 10.4Bash shell
I am looking for a powerful command line tool to send and receive data via socket I mean define IP , port and data other options for command to send and receive data from sender.(like a high level socket programming)
I am trying to write a bash script that sources another bash script. Essentially, I need a few lines to check to see if a certain variable is set. If not, I set it manually, and then source a scripts with that variable in the path. I wrote a test script to try it, but for some reason the last line does not work. Here is what I wrote:
#!/bin/sh source ~setupdir/setup.shrc #just a test, this line works echo ${#SETUP} # prints 0 if setup is not set, which it isn't if [ ${#SETUP} -eq 0 ] then SETUP="~setupdir" fi echo $SETUP # prints ~setupdir
i'm in the process of learing C++. currently i'm creating shell scripts to get things done. i'm just curious how, as a programmer using C++ you would get a similar job done.as an example i have a script that takes the contents of files, pipes it to some sed and awk commands, which is piped to create a new file. that file is then imported into a mysql database.if you were going to do this in C++, would you call the sed/awk programs to modify the file, or can it be done within the program itself? i'm probably jumping the gun here because i've just started learing about pointers so this is above my ability