[phpBB Debug] PHP Notice: in file /includes/db/dbal.php on line 110: Undefined array key "cached"
[phpBB Debug] PHP Notice: in file /includes/db/dbal.php on line 111: Undefined array key "normal"
[phpBB Debug] PHP Notice: in file /includes/db/dbal.php on line 112: Undefined array key "total"
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3391: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3393: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3394: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3395: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
Cabrillo College Linux Classes • View topic - error messages

error messages

Emergency forum when Opus is down

error messages

Postby juliana cheng on Fri Nov 29, 2013 8:26 pm

[code]/home/cis90/chejul/bin/myscript.v5: line 117: t:: command not found
/home/cis90/chejul/bin =
chejul90 is CLOCKED! See I told you so, SORRY! It is not working...????
Hit the Enter key to return to menu[/code]

[code] echo "Note: Use <ctrl-c> to un-stuck"
echo -e "$PWD $PS1=`\t: `"
echo -e -n "` PS1='At'\t: ` $LOGNAME is CLOCKED! "
[/code]

the PS1="\t " command worked before I wrote it into the final project...what do I need to do?
-juliana
juliana cheng
 
Posts: 15
Joined: Wed Nov 27, 2013 4:15 pm

Re: error messages

Postby Rich Simms on Sun Dec 01, 2013 10:05 am

[b]PS1="\t"[/b] [i][color=#00BFFF]will work in the parent shell.[/color][/i]
[b]echo -e "$PWD $PS1=`\t: `"[/b] [i][color=#00BFFF]won't work in either the parent or child process.[/color][/i]

The reason the first one doesn't work in the script is because your script runs as a child process. The child process is not allowed to make changes to the parent's variables. I'm not sure what you are tyring to do in the second line.

Some experiments to try:

1) Replace the second line with the first line above in your script. Immediately after it echo the new value of PS1 with something like:
[b]echo "PS1 has been set to $PS1"[/b]. When you run your script now you should see the child's PS1 variable assigned the prompt code for time. However this will not change the value of the PS1 variable owned by the parent.

2) If that works, then trying sourcing your script so it does not run as a child process.
Use:
[b]. myscript.v5[/b]
or
[b]source myscript.v5[/b]
Now when your script runs it will change the parent's prompt.
User avatar
Rich Simms
Site Admin
 
Posts: 640
Joined: Thu May 15, 2008 2:44 pm

Re: error messages

Postby juliana cheng on Sun Dec 01, 2013 11:06 pm

[quote="Rich Simms"][b]PS1="\t"[/b] [i][color=#00BFFF]will work in the parent shell.[/color][/i]
[b]echo -e "$PWD $PS1=`\t: `"[/b] [i][color=#00BFFF]won't work in either the parent or child process.[/color][/i]

The reason the first one doesn't work in the script is because your script runs as a child process. The child process is not allowed to make changes to the parent's variables. I'm not sure what you are tyring to do in the second line.

Some experiments to try:

1) Replace the second line with the first line above in your script. Immediately after it echo the new value of PS1 with something like:
[b]echo "PS1 has been set to $PS1"[/b]. When you run your script now you should see the child's PS1 variable assigned the prompt code for time. However this will not change the value of the PS1 variable owned by the parent.

2) If that works, then trying sourcing your script so it does not run as a child process.
Use:
[b]. myscript.v5[/b]
or
[b]source myscript.v5[/b]
Now when your script runs it will change the parent's prompt.[/quote]

It is so difficult to type in something here for I cannot see what I am typing..the screen is jumping up and down while Itpe!
Anyway, I found it pretty neat to change the home directory command to a digital clock as a prompt so I came up with the idea to put that into the PS1="\t" as one of the final roject task..with perhaps whomever classmate who logged in and try it to give an out put of==> 12:23:54: you the person logged in chejul you are clocked!
juliana and the ditigial clock changes like a real clock's time as the prompt!
juliana cheng
 
Posts: 15
Joined: Wed Nov 27, 2013 4:15 pm

Re: error messages

Postby juliana cheng on Sun Dec 01, 2013 11:45 pm

[code]/home/cis90/chejul/bin $ PS1="\t"
22:32:50 echo "$PWD"
/home/cis90/chejul/bin
22:33:41[/code]
The child wants to have the parent's prompt..

[code] echo "$NAME is going to change your prompt into a digital clock so don't blink! "

echo "Note: Use <ctrl-c> to un-stuck"
PS1="\t"
sleep 4
echo "PS1 has been set to $PWD"

echo "` PS1='At'\t: ` $LOGNAME is CLOCKED! "
echo "See I told you so, SORRY! It is not working...????"[/code]

[code] Enter Your Choice: 5
is going to change your prompt into a digital clock so don't blink!
Note: Use <ctrl-c> to un-stuck
PS1 has been set to /home/cis90/chejul/bin
chejul90 is CLOCKED!
See I told you so, SORRY! It is not working...????
Hit the Enter key to return to menu[/code]

Before the chujul90 is CLOCKED! there should be a running clock like the first code when ran...
-juliana
juliana cheng
 
Posts: 15
Joined: Wed Nov 27, 2013 4:15 pm


Return to Temporary CIS 90 - Fall 2013

Who is online

Users browsing this forum: No registered users and 0 guests

cron