Sponsored Content
Top Forums Shell Programming and Scripting How to figure out a if insensitive file path exists or not? Post 303041649 by Scrutinizer on Saturday 30th of November 2019 02:17:26 PM
Old 11-30-2019
Ah so it is the other way around? The hostname is always lowercase, but the path may be uppercase?

Try something like:
Code:
cd $(ls -d "$(hostname)"* "$(hostname | tr '[[:lower:]]' '[[:upper:]]')"* 2>/dev/null)

This User Gave Thanks to Scrutinizer For This Post:
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to check if all directories of file's path exists?

I wonder if the script below is possible to write somehow more efficiently. It seems to me the problem is very common.. CreateFolders() # parameter: name of file with relative path with regard to directory $project_root { echo $1 | awk '{ n=split($1, array, "/"); ... (2 Replies)
Discussion started by: MartyIX
2 Replies

2. Shell Programming and Scripting

color a figure in text file

Good morning, Can someone help to color a figure in columns if its exceeding a threshold using shell script . ex. I have file contains 5 columns showing a value in % I need to show the value in red if it exceed 90 % Appreciate your help (3 Replies)
Discussion started by: Bluetoot
3 Replies

3. Programming

C - How to sheck if a path exists?

How do i check if a path exists in C? (5 Replies)
Discussion started by: omega666
5 Replies

4. Shell Programming and Scripting

File exists, but cannot be opened.How to check- whether it could be opened to read when it exists

Hi #Testing for file existence if ; then echo 'SCHOOL data is available for processing' else echo 'SCHOOL DATA IS NOT AVAILABLE FOR PROCESSING' : i wrote a script, where it begins by checking if file exists or not. If it exists, it truncates the database... (2 Replies)
Discussion started by: rxg
2 Replies

5. Shell Programming and Scripting

Help with change significant figure to normal figure command

Hi, Below is my input file: Long list of significant figure 1.757E-4 7.51E-3 5.634E-5 . . . Desired output file: 0.0001757 0.00751 0.00005634 . . . (10 Replies)
Discussion started by: perl_beginner
10 Replies

6. Shell Programming and Scripting

Case insensitive file name search and replace

I am trying to find case insensitive file names and then replace that particular file with other name. if then ls | grep -i "update" | xargs -I {} mv {} LineItems.csv echo "File moved from *update*" elif then ls | grep -i "priority" | xargs -I {} mv {} ... (1 Reply)
Discussion started by: ATWC
1 Replies

7. 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

8. Programming

Makefile missing include path Although the path exists and defined

i have make file which i try to make them generic but it keeps to compline it missing include directory this is the makefile : CXX=g++ CPPFAGS= -Wall -O0 -g -std=c++14 INCLUDES = -I/home/vagrant/libuv/include -Isrc LIBS_DIRS = -L/home/vagrant/libuv/build LDFLAGS=... (7 Replies)
Discussion started by: umen
7 Replies
SSH-ARGV0(1)                                                BSD General Commands Manual                                               SSH-ARGV0(1)

NAME
ssh-argv0 -- replaces the old ssh command-name as hostname handling SYNOPSIS
hostname | user@hostname [-l login_name] [command] hostname | user@hostname [-afgknqstvxACNTX1246] [-b bind_address] [-c cipher_spec] [-e escape_char] [-i identity_file] [-l login_name] [-m mac_spec] [-o option] [-p port] [-F configfile] [-L port:host:hostport] [-R port:host:hostport] [-D port] [command] DESCRIPTION
ssh-argv0 replaces the old ssh command-name as hostname handling. If you link to this script with a hostname then executing the link is equivalent to having executed ssh with that hostname as an argument. All other arguments are passed to ssh and will be processed normally. OPTIONS
See ssh(1). FILES
See ssh(1). AUTHORS
OpenSSH is a derivative of the original and free ssh 1.2.12 release by Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo de Raadt and Dug Song removed many bugs, re-added newer features and created OpenSSH. Markus Friedl contributed the support for SSH protocol versions 1.5 and 2.0. Jonathan Amery wrote this ssh-argv0 script and the associated documentation. SEE ALSO
ssh(1) Debian Project September 7, 2001 Debian Project
All times are GMT -4. The time now is 04:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy