1) I wrote a script and gave the desired permissions using "chmod 755 scriptname". Now if i edit the script file, why do i need to set the permission again? Didn't i set the permission attribute.. or if i edit the file, does the inode number of file changes?
2) I am running my unix on a server as a client and I am writing a command "ls &", which gives me list of file along with the PID. there is one peculiar pattern i have noticed-- if i give the same command again and again in succession, the PID received increases by some units every time.
My query is, is it just a coincidence that PID increases?
3)
In the script above, i am successfully deleting the script file using the same script. How can it be possible? what is the flow of execution for a script file?
I assume the script file info is read first and then executed later on- irrespective of the state of file.
Please help!!
---------- Post updated at 01:50 PM ---------- Previous update was at 11:11 AM ----------
hi all,
i have devised a script that starts in /restored/ and in there, there are a lot of sub folders called peoples names and in the sub folders are files/folders and it deletes the data in the sub folders BUT not the sub folder itself and it should then touch a file in all the sub folders... (3 Replies)
hello guys
i have bash script to open my routers with username and password
i made script but i have problem this script can/t read password from file
#!/bin/bash
router_file="ips"
passwd="password.txt"
for router in cat ;$router_file do
for pass in cat ;$passwd; do
res=$(curl -m 1 ... (7 Replies)
I need to modify a bash script to to take each line in a file and execute command. I currently have this:
#!/bin/bash if ; then echo "Lipsa IP"; exit; fi i=1 ip=$1 while ; do if ; then rand=`head -$i pass_file | tail -1` user=`echo $rand | awk '{print $1}'` pass=`echo $rand | awk '{print $2}'`... (3 Replies)
Hi friends,
Need your help again to get a best approach for the below scenario.
I am previously having one shell script which accepts request_id/s as the command line argument.
single req_id arg= 1111
Multiple arg= 1111,2222,3333
which gets passed to the embedded sql inside to... (9 Replies)
Hi,
I want to write a small code in which script changes command line input to some form.
Example
script.sh a1 a2 a3 a4 .....
output should be "a1|a2|a3|....."
Number of inputs in command line can be any variable (2 Replies)
Hi All,
Do we know how to read input file within awk script and send output toanother log file. All this needs to be in awk script, not in command line. I am running this awk through crontab.
Cat my.awk
#!/bin/awk -f
function test(var){
some code}
{
}
END
{
print"test code"
} (5 Replies)
Hi,
We are having a java server which can run on command line and once initiated, it will prompt options to enter from 0 to 5. The java program kickoff respective operation once number is entered between 0 to 5. However i want to always enter "1" and write another shell program wrapper to start... (4 Replies)
Hello,
I'm trying to figure out how best to approach this script, and I have very little experience, so I could use all the help I can get. :wall:
I regularly need to delete files from many directories.
A file with the same name may exist any number of times in different subdirectories.... (3 Replies)
Hi,
I have this script
Script.sh:
#!/bin/sh
sed 's,\,,g' input.dat > output .dat
But i want to run it witb different files. So i want the input file as an input argument to the script, how could i do that.
Running it like this:
> Script.sh input.dat (2 Replies)
Hi All,
I wish to automate the unix command 'su' through a shell script.
I would like to pass the content of a file as password to 'su' command.
My script is as below,
#! /bin/sh
su userA
while read line
do
rpm -ivh $line
done < pwd.txt
where pwd.txt contains the password of... (6 Replies)