10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hello,
I am creating a file with all the source folders included in my git branch, when i grep for the used source, i found source included as relative path instead of absolute path, how can convert relative path to absolute path without changing directory to that folder and using readlink -f ? ... (4 Replies)
Discussion started by: Sekhar419
4 Replies
2. Shell Programming and Scripting
Hi All,
Need some help in parsing a directory listing .. output into 2 files
Input file
level1,/level2/level3/level4/ora001,10,IBB23
level1,/level2/level3/level4/ora001/blu1,,IBB23
level1,/level2/level3/level4/ora001/clu1,,IBB23
level1,/level2/level3/level4/ora002,,IBB24... (10 Replies)
Discussion started by: greycells
10 Replies
3. Shell Programming and Scripting
Hi All,
i had to split one files into 10 equally. For that i have coded below awk.
OUTPUT_FILE=/home/sit/path/Files/file_EXPORT.lst
DIR_NM=`dirname ${OUTPUT_FILE}`
awk -v CURR_DATE="$(date +'%d-%m-%Y-%H-%M')" -v pth=$DIR_NM '{print >> pth/"tgt_file_name"CURR_DATE"_"NR%10 }' ${OUTPUT_FILE}
... (7 Replies)
Discussion started by: looney
7 Replies
4. Shell Programming and Scripting
My source file is structured with two words on each line
word1 word2
word1 word2
I am using sed and awk to grab groups of specific lines
line=`awk 'NR>=4 && NR<=7' file1`; echo $line
line=` sed -n '1,5'p file1`; echo $line
The resulting output is
word1 word2 word1 word2 word1... (1 Reply)
Discussion started by: bash_in_my_head
1 Replies
5. Shell Programming and Scripting
Hi,
I want to remove a directory path from a file starting with the bracket using sed command.
eg.
(cd /man/abc/def ; \
aaaaa
bbbb
(cd /man/aaaa/aa; \
op.
aaaaa
bbbb
The "(cd /man" is to be consideres as the start.
I tries the below thing, but it didnt worked. Can anyone help.... (3 Replies)
Discussion started by: vdhingra123
3 Replies
6. Shell Programming and Scripting
Hi guys. I'm doing some bash scripting and have run into a snag.
Say I have the path:
/home/one/two/three/
All I need is the 'three' while making a filename.
Is there an easy way to do this? I've tried using grep (because I'm that smart.) cut (as I'm unable to tell how many fields there... (3 Replies)
Discussion started by: Drayol
3 Replies
7. Shell Programming and Scripting
Hi,
I have a file abcd.txt which has contents in the form of full path file names i.e.
$home> vi abcd.txt
/a/b/c/r1.txt
/q/w/e/r2.txt
/z/x/c/r3.txt
Now I want to retrieve only the directory path name for each row
i.e
/a/b/c/
/q/w/e/
How to get the same through shell script?... (7 Replies)
Discussion started by: royzlife
7 Replies
8. Shell Programming and Scripting
if I have a variable value "filetoprocess" equal to "/aaa/bbb/ccc"
How can I simply extract the file name of "ccc" (4 Replies)
Discussion started by: ytakbob
4 Replies
9. Shell Programming and Scripting
Hi
I'll be getting a directory path as the input to the script.
E.g. 1 abc/fsg/sdfhgsa/fasgfsd/adfghad/XXX/fhsad
e.g. 2 sadfg/sadgjhgds/sd/dtuc/cghcx/dtyue/dfghsdd/XXX/qytq
This input will be stored in a variable.
My query is how to extract the field in a variable VAR which occurs... (15 Replies)
Discussion started by: skyineyes
15 Replies
10. Shell Programming and Scripting
Ok, I'm stumped and can't seem to find relevant info.
(I'm not even sure, I might have asked something similar before.):
I'm trying to use shell scripting/UNIX commands to extract URLs from a fairly large web page, with a view to ultimately wrapping this in PHP with exec() and including the... (2 Replies)
Discussion started by: ropers
2 Replies