Sponsored Content
Top Forums UNIX for Advanced & Expert Users A way to print only part of directory path Post 303011588 by Scott on Saturday 20th of January 2018 07:27:08 AM
Old 01-20-2018
That didn't work so well, if logs was the last thing in the path.

Code:
sed -nE "s#(.*/logs(/|$)).*#\1#p"
sed -nE "s#(.*/logs)(/|$).*#\1#p"

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

getting the path part of an argument

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

2. Shell Programming and Scripting

How do I get awk to print a " in it's print part?

The line is simple, use " '{ print $1"]"$2"\"$3THE " NEEDS TO GO HERE$4 }' I've tried \", "\, ^" and '"" but none of it works. What am I missing? Putting in the [ between $1 and $2 works fine, I just need to do the same with a ". Thanks. (2 Replies)
Discussion started by: LordJezo
2 Replies

3. Shell Programming and Scripting

retrieve part of file path

Hi I am trying to use sed to retrieve part of my html file's path. I am having a hard time getting what I want. Could someone give me some help? I want to retrieve the section after html and before the file name For example if I have the following, ... (3 Replies)
Discussion started by: tiger66
3 Replies

4. Shell Programming and Scripting

Howto Print File Path or Print the Filename

I'm trying to clean up my samba share and need to print the found file or print the path of the image it tried to searched for. So far I have this but can't seem to get the logic right. Can anyone help point me in the right direction? for FILE in `cat list`; do if ; then ... (1 Reply)
Discussion started by: overkill
1 Replies

5. Shell Programming and Scripting

Print directory name along with their path

Can any one tell me that how can i print all directory with their path in a given parent directory. i.e. parent directory /home/usr/ Now this shoe directory may contain sevral directory /home/usr dir1/ dir1.1/ dir1.2/ dir2 dir2.1/ dir2.2/ ... (5 Replies)
Discussion started by: jadoo_c2
5 Replies

6. Shell Programming and Scripting

Retrieve directory path from full file path through sh

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

7. Shell Programming and Scripting

print all filenames in directory with path to another file

hi, i have a directory at /path/unix with the following files 1.txt 2.txt 3.txt 4.txt I want to make another file called filenames.txt at a different location called /path/home. So, my output file would be /path/home/filenames.txt with contents /path/unix/1.txt... (1 Reply)
Discussion started by: jacobs.smith
1 Replies

8. UNIX for Dummies Questions & Answers

Extract directory name from the full directory path in UNIX using shell scripting

My input is as below : /splunk/scrubbed/rebate/IFIND.REBTE.WROC.txt /splunk/scrubbed/rebate/IFIND.REBTE.WROC.txt /splunk/scrubbed/loyal/IFIND.HELLO.WROC.txt /splunk/scrubbed/triumph/ifind.triumph.txt From the above input I want to extract the file names only . Basically I want to... (5 Replies)
Discussion started by: IshuGupta
5 Replies

9. UNIX for Beginners Questions & Answers

Convert Relative path to Absolute path, without changing directory to the file location.

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

10. UNIX for Beginners Questions & Answers

What is the difference ../directory path and ./directory path in ksh?

What is the difference ../directory path and ./directory path in ksh? (1 Reply)
Discussion started by: TestKing
1 Replies
MULOG(1)							Museek Daemon Plus							  MULOG(1)

NAME
Mulog - Chat Logging Script for Museekd DESCRIPTION
Mulog is command-line Python script that connects to museekd(1) and saves chat messages into log files. Under the Log Directory, it creates room & private subdirectories and a syslog file. If it loses connection with museekd, it will automatically exit. Setting the interface and password on the command-line is a security risk. Since interface and password settings are saved to the config file when set, you should set them, exit mulog, and restart mulog without the options on the commandline..LP Before running, you will need a working museekd(1) and need to know your museekd interface and interface password. Configure those with musetup(1). SYNOPSIS
mulog [-c <config-filename> ] [--config <config-filename>] [-i <host:port | /socket.path>] [--interface <host:port | /socket.path> [-p <interface-password>] [--password <inteface-password>] [-l <directory>] [--log <directory>] [-v] [--version] [-h] [--help] OPTIONS
Mulog accepts the following options: -c <filename>, --config <filename> Use a different config file. -l <directory>, --log <directory> Use a different chat log directory. -i, --interface <host:port | /socket.path> Choose a different interface (saved to config file) -p, --password <interface-password> Choose a different password (saved to config file) -v, --version Display Version and exit. -h, --help Display Help and exit. EXAMPLE
To run this program the standard way type: mulog Alternativly you use a different config file with: mulog --config mulog.config To set the interface password: mulog --password 1234567890 FILES
~/.museekd/mulog.config The default location for the mulog config file. ~/.museekd/logs/ The default log directory. ~/.museekd/logs/syslog The museekd error/connection log file. ~/.museekd/logs/room/ The directory where chat room logs are stored. ~/.museekd/logs/private/ The directory where private chat logs are stored. AUTHORS
Hyriand <hyriand@thegraveyard.org> daelstorm <daelstorm@gmail.com> SEE ALSO
mucous(1) murmur(1) muscan(1) muscand(1)museekcontrol(1) museekd(1) musetup(1) musetup-gtk(1) museeq(1) daelstorm Release 0.2.0 MULOG(1)
All times are GMT -4. The time now is 07:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy