Sponsored Content
Full Discussion: Using color in scripts
Operating Systems Linux Ubuntu Using color in scripts Post 303033776 by drew77 on Thursday 11th of April 2019 02:19:04 PM
Old 04-11-2019
Something is missing in the code.

Code:
Hilite.sh

-----
 Results, file missing:
/home/andy/bin/Hilite.sh: line 24: my-hilite: command not found

-----
 Results, file present:
/home/andy/bin/Hilite.sh: line 32: my-hilite: command not found

-----
 Results, if only string "File" should be colored:
/home/andy/bin/Hilite.sh: line 40: my-hilite: command not found

 

2 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to change the background color in the init 3 mode(not line color)

Hello, I am using RHEL 6.1 on VMware I am searching for a way to change background color (not line by line color wich one can using tput command) basically changing the color of the whole screen to white instead of the default black and changing font color to black and alos would like to... (2 Replies)
Discussion started by: Dexobox
2 Replies

2. UNIX for Beginners Questions & Answers

Text color in Linux scripts via putty

hi Folks, Can anyone help with changing the color of the words in a linux shell script? I get how to change default background etc in putty, but for some reason the text in the script has different colors for different parts of the cript. Is there a way to have one color in a linux shell... (5 Replies)
Discussion started by: jonnyd
5 Replies
REALPATH(1)							      Debian							       REALPATH(1)

NAME
realpath - return the canonicalised absolute pathname SYNOPSIS
realpath [-s|--strip] [-z|--zero] filename ... realpath --h|--help realpath --v|--version DESCRIPTION
realpath converts each filename argument to an absolute pathname, which has no components that are symbolic links or the special . or .. directory entries. (See realpath(3) for more information.) Each path component in the filename must exist, otherwise realpath will fail and non-zero exit status will be returned. Please note that mostly the same functionality is provided by the `-e' option of the readlink(1) command. When the -s option is used realpath only removes the . and .. directories, but not symbolic links from filename. If the given filename argument is relative (i.e. does not start with `/'), realpath -s prepends to it the current directory name as obtained from the getcwd(2) system call before further processing. Each converted pathname is output to the standard output, on its own line. OPTIONS
-s, --strip Only strip . and .., components, but do not resolve symbolic links. -z, --zero Separate output filenames with the null character instead of newline, so it can be used with the `-0' option of xargs(1). -h, --help Print short usage information. -v, --version Show realpath's version number. EXAMPLES
For the examples below let's suppose that /usr/bin/X11 is a symbolic link, pointing to directory /usr/bin. Example 1 Regardless of what the current directory is realpath /../usr/bin/X11/./xterm prints /usr/bin/xterm but realpath -s /../usr/bin/X11/./xterm outputs /usr/bin/X11/xterm Example 2 When the current directory is /usr/bin/X11 (which is still a symbolic link to /usr/bin), the output of both realpath ./xterm and realpath -s ./xterm will be /usr/bin/xterm Example 3 Providing that the current directory is /home/user (and the directory exists before and during the realpath run), the command realpath ../path/to/some/./non-existent/./directory/../or/../file will fail with the following error ../path/to/some/./non-existent/./directory/../or/../file: No such file or directory but realpath -s ../path/to/some/./non-existent/./directory/../or/../file will return /home/path/to/some/non-existent/file EXIT STATUS
realpath returns a zero exit code when all pathnames were successfully converted. In case of any errors (e.g. missing or unavailable directories in the path), realpath prints error message to stderr and returns a non-zero exit code. SEE ALSO
basename(1), dirname(1), readlink(1), chase(1), realpath(3) BUGS
Hopefully none :) If you find some, please report them via the normal Debian bug reporting system, see the file /usr/share/doc/debian/bug-reporting.txt in the package doc-debian or the reportbug(1) man page. AUTHOR
Originally written by Lars Wirzenius <liw@iki.fi>, as a part of the dwww package. Robert Luberda <robert@debian.org> currently maintains and extends it. realpath is licensed via the GNU General Public License. While it has been written for Debian, porting it to other systems is strongly encouraged. Debian October 16th, 2011 REALPATH(1)
All times are GMT -4. The time now is 10:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy