Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8869261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:26:53+00:00 2026-06-14T17:26:53+00:00

kernel=`uname -s` # Current Kernel name user=`whoami` # Current Unix username time=`date +%H:%M` #

  • 0
kernel=`uname -s`        # Current Kernel name
user=`whoami`            # Current Unix username
time=`date +%H:%M`       # Output current time
current_dir=$(pwd)       # Shell's current location
script_dir=$(dirname $0) # This script's current location

# This if statement is to know the correct location of the script, if the
# shell's location is the same as the script's location
if [ $script_dir = '.' ]; then
    script_dir="$current_dir"
fi

if [ $kernel == 'Linux' ]; then
    # Making symlinks to Vim files, add yours as you need
    echo 'Making symlinks to Vim files'
    ln -s -v $script_dir/vim /home/$user/.vim
    ln -s -v $script_dir/vim/vimrc /home/$user/.vimrc
    ln -s -v $script_dir/vim/gvimrc /home/$user/.gvimrc
    echo "Done at [$time]...\n"

    # Making symlinks to Zsh files, add yours as you need
    echo 'Making symlinks to Zsh files'
    ln -s -v $script_dir/zsh /home/$user/.zsh
    ln -s -v $script_dir/zsh/zshrc /home/$user/.zshrc
    echo "Done at [$time]...\n"

    # Making symlinks to Git files, add yours as you need
    echo 'Making symlinks to Git files'
    ln -s -v $script_dir/git/gitconfig /home/$user/.gitconfig
    ln -s -v $script_dir/git/gitmessage.txt /home/$user/.gitmessage.txt
    echo "Done at [$time]...\n"
fi

Would this work with no problems in Linux? I’m trying to make a make_symlinks.sh file, so I gotta check for Darwin (which already works), but since I don’t have a Linux machine to test with, I don’t know if this script would work in Linux.

So, does this work? Thanks for any help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:26:55+00:00Added an answer on June 14, 2026 at 5:26 pm

    A modified version of your script gives:

    kernel=Linux
    user=david
    time=23:04
    current_dir=/home/david/SO/Test
    script_dir=/home/david/SO/Test
    

    modified script:

    kernel=`uname -s`        # Current Kernel name
    user=`whoami`            # Current Unix username
    time=`date +%H:%M`       # Output current time
    current_dir=$(pwd)       # Shell's current location
    script_dir=$(dirname $0) # This script's current location
    
    # This if statement is to know the correct location of the script, if     the
    # shell's location is the same as the script's location
    if [ $script_dir = '.' ]; then
        script_dir="$current_dir"
    fi
    
    if [ $kernel == 'Linux' ]; then
      echo "kernel=$kernel" 
      echo "user=$user" 
      echo "time=$time"
      echo "current_dir=$current_dir" 
      echo "script_dir=$script_dir" 
    fi
    

    Your ln commands would work:

    NAME
           ln - make links between files
    
    SYNOPSIS
           ln [OPTION]... [-T] TARGET LINK_NAME   (1st form)
           ln [OPTION]... TARGET                  (2nd form)
           ln [OPTION]... TARGET... DIRECTORY     (3rd form)
           ln [OPTION]... -t DIRECTORY TARGET...  (4th form)
    #[...]
           -s, --symbolic
                  make symbolic links instead of hard links
    
           -v, --verbose
                  print name of each linked file
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made a kernel: __kernel void square( __global uchar* input, __global uchar* output, const
Simply I want to clean older kernel's modules. It's uname -r but I need
$ time __git_ps1 ((v2.6.33.4)) real 0m1.467s user 0m0.864s sys 0m0.564s It's making my prompt
What do the various pieces of uname -a output mean? Following is an example
$ uname -a Darwin Wheelie-Cyberman 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36
Kernel threads do context switch at kernel level instead of process level. I am
I know that a kernel may be launched with the triple brackets syntax: kernel<<<NumOfBlocks,
I'm writing a kernel where I need to read certain statistics from iw_statistics structure,
I downloaded the kernel source for htc explorer (pico-gb-crc-2.6.38-71ff0f2). But I cannot find the
I'm writing a kernel module that needs to read the value of bitrate from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.