Hi all,
I am in the progress of consolidating my 2 NIS databases into 1. My first step is to get the NIS record for particular department. I have software.csv which contain list of name in.
software.csv:
John Travolta
Elthon John
Sean King Ston
Taylor Swif t
Nicole cage
.......
I create a simple script to read from software.csv , called genlist.sh
...
User Profile
Collapse
-
Shell script quoting and line read line
-
sed to explode a full path
Hi,
i am quite new to sed and i wonder if there is anyway for me to explode the full path and take the last variable as the string ???
/home/root/usr2/testdir1 --> so i can take testdir1
/home/root/usr2/testdir3
i need to write a script to tar and gzip a list of directory. please help, i am just lacking of sed part.
thanks! -
Hi guys, i managed to solve my problem with the following scripts:
...Code:#!/usr/bin/python import re #fstab location, use w mode as need to overwrite whole file. s = open("/usr2/py/mount.txt","r") #temp txt file to store new mount. tmpfile = open("/usr2/py/tmp.txt","a") #new nas mount point newmount = open("/usr2/py/newmount.txt","r") -
-
Python to search text file string and replace it
Hi ,
i am in the middle of creating the script to match the string and replace it
in mount.txt
mickey:/work1 /work1 bla bla bla
mickey:/work2 /work2 bla bla bla
micket:/job /job bla bla bla
...Code:#!/usr/bin/python import string s = open("/usr2/py/mount.txt","r+") for line in s.readlines(): print line string.replace(line, -
-
Hi again,
i have tried to delete the file in awk using method found via google.
This is working , however when i apply this to the scriptCode:ls -l /usr1/ | grep ^d | grep -v current | awk -v p=103 '{ if ( $9 < p ) system("rm -rf " "\""$9"\"") }'
...Code:echo " ls -l /usr1/ | grep ^d | grep -v current | awk -v p=103 '{ if ( $9 < p ) system("rmLeave a comment:
-
-
Shell Script awk problem , please advice
Hi, i am currently writing a script to delete the directory named with number.
Example:
in /usr/
i have
/usr/101
/usr/102 ...... /usr/200
This is the command i type and it works, i got the directory listed where the number is <150
So i applied it to the script, and it is not working especially...Code:ls -l /usr/ | grep ^d | awk '{ if ( $9 < 150) print $9 }' -
RHEL 4 : how to remove /home automount ?
Hi, I have installed RHEL4 in a box and right now i wanted to have symlink for /home.
The /home by default is automounted(com e with installation). I wanted to remove the automount and create the symlink from /home -> /mydir .
What i did was kill /home process, and rename it to home.old.
Then i create a symlink
ln -s /mydir /home
it works until you reboot the server and... -
Thank you for the solution, it works!
I thought myTemp1 supposed to be string, because i only assigned 1 variable to it. How come it is still array?Leave a comment:
-
Javascript Split problem
Hi, I have written a code to split the string and here is the code.
I managed to get the value from myTemp1(tried it) but i have problem withCode:var myString = (str); var myTemp1 = myString[11].split(",",1); var myTemp2 = new Array(); myTemp2 = myTemp1.split("=",2); var myManager = myTemp2[1];
...Code:myTemp2 = myTemp1.split("=",2); -
Thank you Chaarmann, Your method seems to be more effective way to the javascript. However, i am still facing the same problem even using your suggested way.
here is my function in php:
Javascript:Code:function open_me1(){ window.open('http://www.google.com','height=300','width=250','location=no','menubar=no','resizable=no','scrollbars=yes','status=no','toolbar=no');
...Code:<a href="javascript:open_me1();">Click
Leave a comment:
-
window.open works in Firefox but not IE6/7
Hi, i have tried this code in FireFox and it works great. However , it seems to fail in IE6/7. I have no idea and looking for help here. Please advice. Thank you.
...Code:<a ONCLICK="window.open('http://www.google.com,'height=180','width=250','location=no','menubar=no','resizable=no','scrollbars=yes','status=no','toolbar=no')" href="javascript:void(0)"> Whois Agent local</a> -
Hi, I am using AjaxAgent from ajaxagent.org. I have modified the example code given in http://ajaxagent.org/doc.php . I will not attach agent.php in here(You will need it to run the code below).
...Code:<?php // server side function function getdetail() { exec("ping www.google.com", $coutput); return $coutput; } ?> <?php // STEP 1: INCLUDINGLeave a comment:
-
Javascript split function
Hi, i am currently having problem with the split function. Below are the code:
callback_hello will receive a return string value and store in str_b4_split.Code:function callback_hello(str) { var str_b4_split = (str); var str_af_split = str_b4_split.split(" "); document.write(str_af_split); }
I tried to display str_b4_split , and it is successful... -
Get value from javascript to PHP
Hi,
I am writing a PHP script to get a ping reply from my LAN PC. So, my idea is like this, when i mouseover/mouse click to the "hostname" display on the web. There will be a hint box appear and show me the ping result. Below is the php function to perform exec:
[CODE=php]
function getdetail($user 1)
{
$auser=$user1;
exec("ping $auser", $coutput);
foreach ($coutput... -
Thanks Jeff, you reminded me to put the 'single quote' first before the "double" quote!! I have solved my minor problem now.
Actually i have created a function to search for files for me inside a system. i will named it "getme" in this case.
>getme name.cpp
my function will print the result like this
File(s) Found:
./abc
./123
./321...Leave a comment:
-
Quoting a system call - double vs single
Hi, i faced a problem while executing code in double quote "" and single quote ''
let say example, we type in manually:
>ls abc | grep "\.\/"
it works.
and when i implement this into my script.
$cmd1 = "ls abc | grep '\.\/'" #------> not working
$cmd2 = "ls abc | grep \"\.\/\" # same like previous.
... -
Execute download in Server side.
Hi , i came out with an idea like torrentflux , but this is a little bit different.
I have a shared host, so i am planning to implement a script so that whenever i try to download a file, i will key in the address to the form, and once i submit the form, It will start downloading that particular file.
Is this possible to do it with PHP and in server side as well? please advice.
thank you
No activity results to display
Show More
Leave a comment: