hi all,
got this silly problem and i just can't seem to make sense of the error message its is saying 1400: cannot open. its my first time at writing a while loop but tried all sorts to get it working without success.
#!usr/bin/ksh
integer max=1400
set file="afilename"
integer i=1
... (3 Replies)
hi all
i have to copy files from server A to server B,and at the same time create a back up of the existing files on server B and delete the uncommonm files between both the servers,please any help will be appreciated.
thnks
bkan (1 Reply)
Today I logged as root on my HP-UX server and by mistake executed below command
# ksh -i vi
Then onwards for every root logging the ksh shell giving wired output to every command
e.g
# ls
kÚ
.brw_history
.brwpause
.brwtmp
: : :
1+~H4p+À+~KÑ
1+Ðè
d
15kÚ
1d+~èYÑd:ðè½h|À+~èY4:àh|À+
And so... (6 Replies)
Hi All,
Please help me out in this... I am new to scripting
How to compare two strings by using the same string in single loop,
I am using ksh
for ex:see the code snippet below
I am writing in java,
Can u guys tell me that in scripting
if ("string1"=="string2" ||... (2 Replies)
H,
I am running the following log.sh shell script.
$no_of_ps=7
while
do
echo "hello $no_of_ps"
ps_file=`tail -$no_of_ps /tmp/A380_RFS24/test.ls | head -1`
no_of_ps=`expr $no_of_ps - 1`
echo "package is: $ps_file" >> /tmp/A380_RFS24/log/A380_RFS24.log
ps_file1=`echo $ps_file| sed... (1 Reply)
hey guys,
I have a few general qns, so I'd appreciate quick responses.
1. How do u read a file line by line and display its contents using KSH?
2. How to kill a process using only the name?
3. How to create an empty file with 1MB memory size?
4. How to append some content to an existing... (3 Replies)
Hi ALL,
I need to take some command line arguments for my script and then want to run a function for each argument.I thought of using for loop as below, but its not working , can some one please help...
#!/bin/ksh
lpar1=$1
lpar2=$2
lpar3=$3
lpar4=$4
lpar5=$5
echo "$lpar1" >>lpar.txt
echo... (4 Replies)
Hello....
I'm developing a script; the first step is to create a file (its name is IP) which contains several lines. The second step is to create and execute expect programs using the data in the (IP) file.
Unfortunately, the loop is not executed properly....sometimes, the 2nd expect file is... (2 Replies)
Hi,
I want to read file multiple times. Right now i am using while loop but that is not working.
ex.
While read line
do
while read line2
do
echo stmt1
#processing some data based on data.,
done < file2.txt
done < file1.txt # This will have 10... (4 Replies)
Hi All,
I'm trying to write while loop with multiple if conditions. Each and every if condition with different variables. whenever one if condition fails i have remove the file
from filename and have to pick another file and loop should exit until the last file found in filename. Please help... (4 Replies)
Discussion started by: Kayal
4 Replies
LEARN ABOUT LINUX
remove
REMOVE(3) Linux Programmer's Manual REMOVE(3)NAME
remove - remove a file or directory
SYNOPSIS
#include <stdio.h>
int remove(const char *pathname);
DESCRIPTION
remove() deletes a name from the file system. It calls unlink(2) for files, and rmdir(2) for directories.
If the removed name was the last link to a file and no processes have the file open, the file is deleted and the space it was using is made
available for reuse.
If the name was the last link to a file, but any processes still have the file open, the file will remain in existence until the last file
descriptor referring to it is closed.
If the name referred to a symbolic link, the link is removed.
If the name referred to a socket, FIFO, or device, the name is removed, but processes which have the object open may continue to use it.
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
ERRORS
The errors that occur are those for unlink(2) and rmdir(2).
CONFORMING TO
C89, C99, 4.3BSD, POSIX.1-2001.
NOTES
Under libc4 and libc5, remove() was an alias for unlink(2) (and hence would not remove directories).
BUGS
Infelicities in the protocol underlying NFS can cause the unexpected disappearance of files which are still being used.
SEE ALSO rm(1), unlink(1), link(2), mknod(2), open(2), rename(2), rmdir(2), unlink(2), mkfifo(3), symlink(7)COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 2008-12-03 REMOVE(3)