10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi,
So I struggled to find a solution to the following problem:
I want to make sed print only part of multiple different paths.
So lets say we have
/path/path1/path2/logs/bla/blabla
/path/path1/path2/path3/logs/yadda/yadda/yadda
Can someone suggest a way to make sed or other... (5 Replies)
Discussion started by: dampio
5 Replies
2. Shell Programming and Scripting
Hi i'm new to shell script,
i want to get the filename from specific location which i mentioned in my script.
The scirpt should read the filename exactly using the following command "ls -ltr | tail -1".
Could someone show me on this. Below is my script
#!/bin/ksh
PATH= /usr/
if
then
... (4 Replies)
Discussion started by: fresher
4 Replies
3. Shell Programming and Scripting
I'm trying to replace path which is part of variable inside script file:
FROM:
ABC_HOME=$ABC_ROOT/abc/1.0
TO:
ABC_HOME=$ABC_ROOT/abc/1.5
I'm using this:
perl -pi -e 's\ABC_HOME=$ABC_ROOT/abc/1.0\ABC_HOME=$ABC_ROOT/abc/1.5\g' /apps/scripts/test.sh
This command is not working because... (2 Replies)
Discussion started by: djanu
2 Replies
4. 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
5. UNIX for Advanced & Expert Users
Let say I have /home/user1/bin/ and i want it to be /root/bin
I tried : s/\/home\/user1/user2/
but it can't find the pattern user1.
I tried: s/*\/home\/user1*/user2/
as well same result
many thanks (4 Replies)
Discussion started by: c00lsnoopy
4 Replies
6. Shell Programming and Scripting
Hi
I have two path as follows
system/console/bin/code/sample/testfile.txt
system/console/bin/database/files/new/dbfile.txt
I need the output as
code/sample in first case
database/files/new in second case
That is I am omitting system/console/bin and the filename(s) in both... (2 Replies)
Discussion started by: ssuresh1999
2 Replies
7. Shell Programming and Scripting
Hi all,
I am learning the use of regular expression and I would like to know which regex can be used to select only the last part of a directory path name.
Something like:
/dir1/dir2/dir2
and I want to select the last /dir2 where dir2 can be any kind of string.
Thanks a lot for your help.... (7 Replies)
Discussion started by: elric
7 Replies
8. Shell Programming and Scripting
Hi
I have a word assigned to the variable, for example:
A=TTOP
Is there a way to remove the first letter from this word and assign the rest of the word to another variable, so the output would be like this:
B=TOP
Thanks a lot for any advice.... -A (2 Replies)
Discussion started by: aoussenko
2 Replies
9. UNIX for Dummies Questions & Answers
Hi all,
Does anyone know how to ammend the .cshrc file in $HOME for your session to display the path as part of the command line? So that I dont need to keep on typing pwd to see where I am?
thanks
Ocelot (3 Replies)
Discussion started by: ocelot
3 Replies
10. Shell Programming and Scripting
Seems I'm inundating this forum with questions, but anyway:
I am writing a script that should accept one and only one argument when called.
That argument should designate a file, either with path/filename or just filename.
Now to the difficult bit:
I want to figure out a way to store... (9 Replies)
Discussion started by: ropers
9 Replies