I have a variable (call it $valAS) that gets calculated . Also, i have a files Bassu3. if $valAS= 45368 (2nd part of 2nd line in Bassu3) after calculation, then $result=45368, but if $valAS != 45368 then $result= $valAS
Bassu3:
Quote:
name.srv
name 45368 (value always changing)
name 99999
name 88888
I wanted to get the ORACLE_HOME of the listener's running on the server.I have been using the following to get the reult. /opt/oracle/admin/PHYPE/bdump> ps -ef|grep /bin/tnslsnr|grep -v grep|awk '{print $9}'
I'm using the following awk command to find out the users home directory from /etc/passwd file.#grep jeesun /etc/passwd |awk 'BEGIN {FS=":"};{print $6}'But problem is when there are two name like "jeesun" and "jeesunadm" exist the script shows both result not specific one.
It is under PHP/MySQL $queryresult = $conn->query("INSERT INTO normalrequests VALUES($finalkey, 1234, 5678, FALSE)"); It is connected to the database successfully but I feel there is something wrong with the statement up there.
I'm trying to create a program that would locate the oldest file of a certain type on a server. Here's the commands:
OLDEST_PATH=`find -L / -depth -maxdepth 6 -mindepth 6 -type d | sort -f | head -1` OLDEST_FILE=`find -L $OLDEST_PATH | grep .mp3 | sort -f | head -1` ls -al $OLDEST_FILE
I'm writing this all in expect but I'm having problems. The main problem I have is whenever I try to run the first command, I can't seem to isolate the result of the OLDEST_PATH so that the 2nd command will work. There always seems to be a newline in the variable and the result is only "find -L" command running and it bypasses the variable. If I can just figure out how to get the 1st and 2nd command to work, then I can figure out the 3rd. Here's some code:
I know there is a better way to write this. I've tried multiple ways and this just happens to be the last way I've tried it. If you try running this, you'll notice that there is still carriage returns after the result of OLDEST_PATH and it prevents the 2nd "find" command from working properly.
I am using the script below but need to make it to show the result in a html popup window. The script is Free and I don't think Kristina will complaint by making it more versatile.
The problem I have is that the script moves to a standalone window to show the results. I am interested in making it "popup' a window with the results.
Code: #!/usr/bin/perl # NOTE: You must change the line above to point to the path to Perl # on your system. ######################################################################### ##### AffordaBilly v1.0# ##### Copyright 2001, Kristina L. Pfaff-Harris, scripts@tesol.net#
I am new to perl and am having trouble adding some strings together.
My full code is below:
The problem is $NewCommandB is always split into two lines, where the second line contains the "/atlas2/<blah>/<etc>/..." string. Since I am generating a .sh file to execute a lot of similar commands I need the string to all be on one line. Any idea why I get this behaviour and any suggestion on how to tell perl to make $NewCommandB a one line string?
Btw for completeness finalFileList.txt contains just file names one line after another:
I am not sure if this is possible. I have IP's stored in a mysql database. When I query the database, it returns the IP. I would like to replace the IP with something else prior to displaying the results. Is it possible even though I have not stored it in the database?
I have the following in a while loop (mysql_fetch_array).
Code: <td align="left">' . $row[IP] . '</td>
Instead of displaying $row[IP] from the database, I would like it to display something else which I define in the PHP code but based on the IP.
What i am trying to do is i want to add numbers from 1 to 100. but that too using multiprocessing. So i made a c programme and using fork() command made two child processes. Now in one child process i am adding from 1 to 50. and in another i am adding 51 to 100. and then in the parent process adding the two results to get the final one. Now the result from the two function i am getting correctly. But after the wait() call the value returned is lost : See the programme below for reference
reading through the documentation for pk2cmd, required for using the PICkit2 programmer. I aim to install using the source, and thus libusb-dev is needed. The docs says that the runtime is usually included with the distro but the dev-part is not. Well, to be on the safe side, I downloaded the source for libusb (0.1.12), which in turn should contain libusb-dev.One step down, a few more to go. pk2cmd should be pretty straightforward to compile, but ...
Now I am asked to set up USB so that it can be used by users other than root. A document is filled to the brim with instruction for cases old and new. It makes my head spin and that's why I am asking. The programmer shows up fine with lsusb,I see it as/dev/bus/usb/001/006So, basically, as I understand it, the device need the proper rights to be used by a regular user. But how do I do that?
I'm running into a problem when I try to set a variable to an awk output in c-shell. Right now my command is Code: set STR_MSG_TYPE = `awk -F{ '/msg_type/ {print $2}' <filename> | tr -d }'/''*' ` I then run echo to see what the output is and it returns blank, however, when I run the same awk command from the command line, I get an actual output of "MT-715". Am I setting my variable incorrectly? I do something similar using the date command to set a STR_DATE variable earlier in the code and it works fine and I use the same syntax.
I have a configuration file I put ndd commands into for servers settings and I'm running into and issue where they are only off by one character so I keep overwriting the setting.
The file has these two lines in it:
As you can see the only difference is the q0 on the one entry. With the code below I just keep changing/adding a line to the file and not just finding and fixing the each line. I cannot seem to find the right "terminator" for an exact match. I do understand why it's doing it, I just don't know what to do to fix it. What am I missing?
In the end I just want to search this file and make sure these two lines are in there and set properly.
I'm working on a backup script which takes the following input:
Code: RevBackup.sh <options> <source> <target>
The problem I'm having is that the source and target might contain spaces in the path. ie. /home/eRJe/My Documents
I would like the script to ignore " " (backslash-space) as being a delimiter. how could I do this without stopping a normal space from being a delimiter?
I could do this with IFS. But so far I have only found info about setting a delimiter and not to "ignore" one
I would like to install PostgreSQL 8.5 from this link [URL], but it complains that it needs rpm-4.6.0 as dependency. It seems that CentOS does not support rpm with version bigger than 4.2.2, or am I wrong?
I have the following function, and it appears to set the var correctly, but then tries and executes the line as a command. Anyone know how to keep it from doing that?
I am trying to execute executable files in bash without adding ./ I know there must be an alias to add in .bashrc, that must be something like alias PATH=$PATH:. But this seems not to be working.
I am creating a script for making a public folder in linux. The idea behind is to allow any user to write files in this folder and further each of those files can be used by any user. For this purpose I am using acl. This first requires to set acl as mount option in /etc/fstab which I need to do with help of (awk and sed) command available in linux.
The line below is the fstab entry which I need to make change in. UUID=e9a3db4b-d8c0-40b4-a661-131e13afea1e /ext3 relatime,errors=remount-ro 0 1
I want my script to identify this line (most probably with / which denotes the mountpoint) and then add (acl,) without brackets in options. Currently I use the command as below sed 's/realtime/acl,relatime/' /etc/fstab but the above command is in reference with (realtime) what I am planning is that my script should be able to find the line which has / and then go to options and add acl there.
I have 3 files: main.c, mylib.h, mylib.c Now I want to put mylib.h into : /usr/include/mydir/mylib.h And I create a static library: libmylib.a, and put into the folder: /usr/lib/mydir/libmylib.a Then I compile: $ gcc -o main main.c Then I got linking error
Code: main.c:(.text+0x3e): undefined reference to `extract_v1' main.c:(.text+0x7b): undefined reference to `modify_v1' collect2: ld returned 1 exit status
So I try with -l options: $ gcc -o main main.c -lmylib I still got error
Code: /usr/bin/ld: cannot find -lmylib collect2: ld returned 1 exit status Any idea about this?
Also, I want to ask about: how to create my own header and library to put into /usr/include/mylib/ and /usr/lib/mylib/, so when I use function in my program, the compiler will automatically link to library. It's like when you #include <stdio.h>, and you compile: $ gcc -o program program.c, you don't need to specify any linking folder or library.
I have this piece of code in my shell script file: Code: useradd $UserName; passwd <& $password I am not able to perform Input Redirection while setting password programatically- without any user intervention. I think there is a way to do it, but it is just getting slipped from my mind at the moment.
there is any possibility that I can set in this application an affinity so that the processor binds it to core 2 for instance.Is this possible to do in an application that runs than under root? Or is this just possible after the application started with using the taskset tool?
Anybody know of any Firefox 3.5 final RPMS for Fedora 10? I looked a rebuilding the Fedora 11 RPMS for Fedora 10, but the other packages requiring an upgrade as well is getting out of control.