Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Help needed with Linux homework...

    hi, im new to the forums and to linux, and im having a bit of trouble with my Linux homework.. its not that im lazy or anything, i've read the chapter for my class 3 times, and im still stuck on these three questions. if you could please explain to me the answers, i really would appreciate that.

    1.) Write a sequence of commands or a script that demonstrates that variable expansion occurs before pathname expansion.
    __________________________________________________ ____

    2.) Explain the behavior of the following shell script:

    $ cat quote_demo
    twoliner=”This is line 1.
    This is line 2.”
    echo “$twoliner”
    Echo $twoliner

    a. How many arguments does each echo command see in this script? Explain.
    b. Redefine the IFS shell variable so that the output of the second echo is the same as the first.

    __________________________________________________ ____

    3.)The dirname utility treats its argument as a pathname and writes to standar output the path prefix – that is, everything up to but not including the last component:

    $dirname a/b/c/d
    If you give dirname a simple filename (no /charcters) as an argument, dirname writes a . to standar output.
    $ dirname simple

    Implement dirname as a bash function. Make sure that it behaves sensibly when given such arguments as /.

  2. #2
    Join Date
    May 2004
    arch linux
    Welcome to the forums, hawkeye107!

    Sorry, but we don't allow homework questions here on the forums.

    Please read over the Forum Rules before posting.

    Locking this thread.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts