Posted on 2012-09-13
Last Modified: 2012-09-14
1. chmod –x
2. What is $1

Just a few questions to ask.
I'm pretty sure about the first code but not the second code

1. makes to not executable

2. what does $1 do in linux script

thank you for your help.
Question by:bt1942
    LVL 37

    Assisted Solution

    by:Gerwin Jansen
    $1 is the first parameter you give to the script on the command line
    LVL 37

    Accepted Solution

    Try creating a basic script like this:

    echo "Your first parameter is: $1"

    and call the script like this:

    sh something

    it should echo this:

    Your first parameter is something


    chmod -x removes all x bits from the file so if the file's protection was:


    after chmod -x it would become:

    LVL 12

    Assisted Solution

    $1 is a variable that represents the first argument on a command line

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
    It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now