06-02-2008
Thank raj....
can we give the directory path inside the program...not in comman line....i m writing a program in a file...then i m executing that file...so can u tell me that how can we give the directory path inside the program...i tried a lot....
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hi
can i know how to get the file name of any files containing for example "abc" from a number of files in a directory?
i tried "ls -ltrc | grep abc" but no resulted generated.
thanks in advance. (1 Reply)
Discussion started by: legato
1 Replies
2. Shell Programming and Scripting
If I have data as below :
1,ABC,XXXX
2,ABC000,YYYY
3,DEF,AAAA
4,ABC0,ZZZZ
I want to get records whose 2nd col exactly match with word 'ABC'
I am using command below :
awk -F"," '$2~/ABC/' Filename
It is retrieving records as -
1,ABC,XXXX
2,ABC000,YYYY
4,ABC0,ZZZZ
But in... (8 Replies)
Discussion started by: videsh77
8 Replies
3. Shell Programming and Scripting
Hi,
I have list of directory paths in a variable and i want to delete those dirs and if dir does not exist then search that string and get the correct path from xml file after that delete the correct directory. i tried to use grep and it prints the entire line from the search.once i get the entire... (7 Replies)
Discussion started by: dragon.1431
7 Replies
4. Shell Programming and Scripting
Hi,
I have to search a word in a text file and then I have to delete lines above from the word searched . For eg suppose the file is like this:
Records
P1
10,23423432
,77:1
,234:2
P2
10,9089004
,77:1
,234:2
,87:123
,9898:2
P3
456456
P1
:123,456456546
P2
abc:324234 (2 Replies)
Discussion started by: vsachan
2 Replies
5. UNIX for Dummies Questions & Answers
Hi, i am new to unix shell scripting and i need a script which would search for a particular word in all the files present in a directory. The output should have the word and file path name. For example: "word" "path name".
Thanks for the reply in adv,:) (3 Replies)
Discussion started by: virtual_45
3 Replies
6. Shell Programming and Scripting
I have a data in a file like this
1 praveen bmscollege
2 shishira bnmit
3 parthiva geethamce
I want to search "praveen" using awk command i tried like this but i did not get
awk `$2="praveen" {print $0} ` praveen.lst
can anyone help me solving this problem in... (2 Replies)
Discussion started by: praveenhegde
2 Replies
7. Shell Programming and Scripting
I have a file input.txt which have loads of weird characters, html tags and useful materials. I want to display 35 characters after the word description excluding weird characters like $$#$#@$#@***$# and without html tags in the new file output.txt. Help me. Thanx in advance.
My final goal is to... (11 Replies)
Discussion started by: sachit adhikari
11 Replies
8. Shell Programming and Scripting
I have a file input.txt which have loads of weird characters, html tags and useful materials. I want to display 35 characters after the word "description" excluding weird characters like $&lmp and without html tags in the new file output.txt. Help me. Thanx in advance. I have attached the input... (4 Replies)
Discussion started by: sachit adhikari
4 Replies
9. Shell Programming and Scripting
Hi- I have issue with the code to get the input file reformat
--Goal is reformat and print out only column name one per line, leading space or trailing space will be removed...
--TABLE1.DDL as input file, and content of file as show below
REPLACE VIEW TABLE1
(
ID
,COL1
... (3 Replies)
Discussion started by: lv99
3 Replies
10. UNIX for Beginners Questions & Answers
I have a multicolumn text file with header in the first row like this
The headers are stored in an array called . which contains I want to search for each elements of this array from that multicolumn text file. And I am using this awk approach
for ii in ${hdr}
do
gawk -vcol="$ii" -F... (1 Reply)
Discussion started by: Atta
1 Replies
chdir(2) System Calls Manual chdir(2)
NAME
chdir, fchdir - change working directory
SYNOPSIS
DESCRIPTION
and cause a directory pointed to by path or fildes to become the current working directory, the starting point for path searches of path
names not beginning with path points to the path name of a directory. fildes is an open file descriptor of a directory.
For a directory to become the current working directory, a process must have execute (search) access to the directory.
RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and is set to indicate the error.
ERRORS
fails and the current working directory remains unchanged if one or more of the following are true:
A component of the path name is not a directory.
The named directory does not exist.
Search permission is denied for any component of the path name.
path points outside the allocated address space of the process. The reliable detection of this error is implemen-
tation dependent.
path is null.
The length of the specified path name exceeds
bytes, or the length of a component of the path name exceeds bytes while is in effect.
Too many symbolic links were encountered in translating the path name.
fails and the current working directory remains unchanged if one or more of the following are true:
Search permission is denied for
fildes.
fildes is not an open file descriptor.
The open file descriptor
fildes does not refer to a directory.
AUTHOR
and were developed by AT&T Bell Laboratories and HP.
SEE ALSO
cd(1), chroot(2), privileges(5).
STANDARDS CONFORMANCE
chdir(2)