10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello all!
I am on Mac (10.8.4) and my shell tcsh (man says version: Astron 6.17.00). Just to precise my tcsh:
echo $LC_CTYPE
UTF-8
I want to replace all ':' with a new line, to get all paths on one line. I don't find a way to make my shell accept the "\n"
My start was:
echo... (17 Replies)
Discussion started by: marek
17 Replies
2. Shell Programming and Scripting
Hi,
I am attempting to find the path /subject/grin* and replace it with /subject/$i
My attempt:
for i in $(ls)
do
sed -e 's:"/subjects/grin.*":"/subjects/$i.*":g'
and several variants with no luck. Please help. Thanks! (8 Replies)
Discussion started by: JC_1
8 Replies
3. 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
4. Shell Programming and Scripting
Hi,
I have following path:
set file_path = D:/forums/prac/somedir/new1/file1.txt
or set file_path = E:/new/forums1/prac/somedir/new2/file2.txt
I need to grep "somedir" from file path. In this case preceding directory "prac" remains same for both the paths, but directories preceding... (7 Replies)
Discussion started by: sarbjit
7 Replies
5. Shell Programming and Scripting
Hi I'm trying to select text between two lines, I'm using sed to to this, but I need to pass variables to it. For example
start="BEGIN /home/mavkoup/data"
end="END"
sed -n -e '/${start}/,/${end}/g' doesn't work. I've tried double quotes as well. I think there's a problem with the / in the... (4 Replies)
Discussion started by: mavkoup
4 Replies
6. Shell Programming and Scripting
Hi ,
Hi I want to know how can i extract file path using sed?
Eg: C:/folder1/abc/file.txt
Now , i want C:/folder1/abc/ only, So that i can move to that directory containing that file . So how can i do it using sed?
Thanks in Advance
Sarbjit (2 Replies)
Discussion started by: sarbjit
2 Replies
7. Shell Programming and Scripting
hi,
I have a file path like usr/scripts/pass/bin and usr/scripts/pass/line
I want to extract first three characters using sed
Like for path usr/scripts/pass/bin i want to extract usr/scripts/pass
and for path usr/scripts/pass/line i want to extract usr/scripts/pass (10 Replies)
Discussion started by: Diggi
10 Replies
8. Shell Programming and Scripting
I have a variable called PATH that contains a path
example: /Users/rtipton/Desktop/testusers/test
I need a sed command to set a variable called USER to the last directory name in that path
PATH="/Users/rtipton/Desktop/testusers/test"
and from that PATH i need USER to = test
I know sed... (4 Replies)
Discussion started by: tret
4 Replies
9. Shell Programming and Scripting
hi,
i need to replace a line a file with a new raw device location..
original file..
/opt/sybase/ASE1502/ASE-15_0/bin/dataserver \
-d/data/TST_AKS1/sybdevices/master.dat \
-e/logs/sybase/TST_AKS1/SFO_TST_AKS1.log \
-c/apps/sybase/ASE1502/ASE-15_0/TST_AKS1.cfg \... (2 Replies)
Discussion started by: aksaravanan
2 Replies
10. Shell Programming and Scripting
Hi,
How can I get /usr/people/me/
from /usr/people/me/file.abc
with sed?
Thanks... (2 Replies)
Discussion started by: cybotic
2 Replies