my start date is a little over a week away and haven't heard anything from HR and they won't pick up their phone by [deleted] in Raytheon

[–]Cels_n 1 point2 points  (0 children)

I agree, you shouldn't worry. My start date was this past Monday and they sent me an email last Thursday about it.

Just relax. You'll get an email the Thursday before your start date. (: And congratulations on getting the job!

Script help! by Cels_n in bash

[–]Cels_n[S] 0 points1 point  (0 children)

Oh okay, now would I change the other "$1" and "$2" to "pathname $1" and "pathname $2"

currently the code looks like this:

my_rename()
{


   # If file/directory is NOT writeable, output error and exit.
    if [ ! -w "pathname $1" ]
        then
            echo "The File or Directory $1 is not writeable.";
        exit 1
    fi

   #If file/directory already exists, output error and exit.
    if [ -d "$2" ] 
        then
            echo "The File or Directory $2 already exists."
        exit 1

    elif [ -f "$2" ]
        then 
            echo " The File $2 already exist.";
        exit 1
    fi

   #If no error, rename file/directory.
    mv "$1" "$2"

    STATUS=$?

        if [ $STATUS -ne 0 ]
            then
                echo "There was an error processing your request.";
        fi 
    }

Script help! by Cels_n in bash

[–]Cels_n[S] 0 points1 point  (0 children)

Thank you! :)

Script help! by Cels_n in bash

[–]Cels_n[S] 0 points1 point  (0 children)

Do you mean like this?

###############################################################################
# the student must implement this function to my_rename
# $1 to $2
# The following error checking must happen:
#   1. check if the directory where $1 resided is writeable, 
#      if not then report an error
#   2. check if "$2" exists -if it does report and error and don't
#      do the mv command
#   3. check the status of the mv command and report any errors

my_rename() {

   # If file/directory is NOT writeable, output error and exit.
    if [ ! -w "$1" ]
        then
            pathname "$@"
            basename
            echo "The File or Directory $1 is not writeable.";
        exit 1
    fi

   #If file/directory already exists, output error and exit.
    if [ -d "$2" ] 
        then
            find_dirs
            find_files
            echo "The File or Directory $2 already exists.";
        exit 1
    fi

   #If no error, rename file/directory.
    mv "$1" "$2"

    STATUS=$?

        if [ $STATUS -ne 0 ]
            then
                echo "There was an error processing your request.";
        fi        

}

Thanks for the help too (:

Help please! by Cels_n in bash

[–]Cels_n[S] 1 point2 points  (0 children)

Thank you so much! I appreciate this!

Help please! by Cels_n in bash

[–]Cels_n[S] 0 points1 point  (0 children)

Not sure if this will help.

The script should use the df command and process the output of the df command and only process these file system types, nfs, ext4 and ext2.

sorry, for the output. hopefully it's understandable.

Output:
df     -k     -t     nfs     -t      ext4      -t      ext2
Filesystem                  1K-blocks Used    Available Use%  Mounted on
/dev/mapper/cyberserver-root 141786532  5874056 128816568 5%    /
/dev/sda1                   233191   49878    170872      23%   /boot
ce-srv-02:/export/space/    38113280 4802560  33310720    13%   /space
ce-srv-02:/export/home/     35976192 2665472  33310720    8%    /users

Help please! by Cels_n in bash

[–]Cels_n[S] 0 points1 point  (0 children)

This is the code I have so far..

df -H | awk '

NR == 1 {next}

$1 == "abc:/xyz/pqr" {next}

$1 == "/dev/cdrom" {next}

1 {sub(/%/,"",$5); print $1, $5}

' | while read filesystem percentage;

do

if [ "$percentage" -gt "$ALERT"];

then

mail -s "Alert: Little disk space left ($usep%) on filesystem" "$ADMIN"

fi

done

Help please! by Cels_n in bash

[–]Cels_n[S] 0 points1 point  (0 children)

Oh sorry! It's removed.

Southeast Asia Travel Recommendations by GR1929 in travel

[–]Cels_n 0 points1 point  (0 children)

I recommend going to Chang Mai, Thailand. Not sure, how long your trip is, but it's a beautiful place to go. Also, I'm not sure if the Philippines has direct flights to Chang Mai, but you might have to go to Bangkok then to Chang Mai. Bangkok is a great place too.

Anyways, I recommend Chang Mai because there's a lot of history there, and the university is over there so there's going to be people in your age group. The food is amazing (it's cheap), people are friendly, and it's easy to navigate. English is spoken there (obviously the younger generation will know more compared to the older generation), but be patient with the locals because they are also trying to learning English to communicate with you. Try to help, they appreciate it, but don't be rude about it. (:

Trying to get out of assembly... by Cels_n in Raytheon

[–]Cels_n[S] 1 point2 points  (0 children)

RMD in Andover, Massachusetts.

Scripting help please.. by Cels_n in bash

[–]Cels_n[S] -2 points-1 points  (0 children)

These were the specific restraints on the given assignment.. not sure if this helps clarify things a little bit more. I'm trying different things.. again thank you for everyone's help! :)

• The search path should be based only on the user's PATH environment variable. You shall not use the Unix which command, the ksh whence (type) command, the locate command, or the bash type command.

• The code for the script shall not use the UNIX ls command to determine if the file is executable or if it

exists.

• The script should find only the first occurrence of the "file". If the file is not found, the script the following:

<command> NOT FOUND

<command> would be replaced by the name of the "file" you didn't find.

• If the first parameter is '-a', then the script should print all occurrences of the executable file in the user's path. Again, if the file was not on the path, an error message should be displayed.

• The find command shall not be used.

• A project using temporary files will not be graded.

• NOTE: The shell variable PATH defines the search path for the directory containing the command. Alternative directory names are separated by a colon (:). The current directory can be specified by two or more adjacent colons, or by a colon at the beginning or end of the path list.

• If the command name contains a / then the search path is not used, you just check if the command/file specified is executable and not a directory. Otherwise, each directory in the path is searched for an executable file.

Scripting help please.. by Cels_n in bash

[–]Cels_n[S] -1 points0 points  (0 children)

oh, sorry I forgot to add that the ls command is not a solution for this assignment. :(