Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › [Bash] My script won't update. Help.
New Posts  All Forums:Forum Nav:

[Bash] My script won't update. Help.

post #1 of 7
Thread Starter 
Real quick:
I'm pretty much a UNIX/Linux noob.
I'm using Damn Small Linux through my Windows desktop with QEMU.
This is just a script to be called in bash.

The problem:
I'm writing a very simple script, but when I change it in the notepad editor (in Damn Small) and save, running the script in Bash doesn't update.

As an example of the problem:
test_script ()
{
echo "Hello!"
}

Outputs:
Hello!

Now I add some code (the new in bold):
test_script ()
{
echo "Hello!"
echo "This is a test..."
}

When I save the file and call the script again, it outputs:
Hello!

Where is the rest of my code? It will only update what's added to the file if I save it under a different name. That's not right, is it?
    
CPUMotherboardGraphicsRAM
E6420 L644G @ stock Asus P5N-e SLI w/ BIOS 13.01 eVGA G80 GTS 320MB @ stock 2GB GEIL PC6400 @ stock 
Hard DriveOptical DriveOSMonitor
Seagate 320GB 7200.10 SATA 3Gb/s & WD 200GB IDE Lite-On Dual Layer DVD burner Windows 7 RC 32bit Gateway FPD2275W 22" @ 1680x1050 
KeyboardPowerCaseMouse
ativa micro Thermaltake Purepower RX 600W, 48A [TBD] w/ 2x 12cm 133cfm Ultra Kazes & 12cm S-Flex MX518 
Mouse Pad
Memory foam wrist rest 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
E6420 L644G @ stock Asus P5N-e SLI w/ BIOS 13.01 eVGA G80 GTS 320MB @ stock 2GB GEIL PC6400 @ stock 
Hard DriveOptical DriveOSMonitor
Seagate 320GB 7200.10 SATA 3Gb/s & WD 200GB IDE Lite-On Dual Layer DVD burner Windows 7 RC 32bit Gateway FPD2275W 22" @ 1680x1050 
KeyboardPowerCaseMouse
ativa micro Thermaltake Purepower RX 600W, 48A [TBD] w/ 2x 12cm 133cfm Ultra Kazes & 12cm S-Flex MX518 
Mouse Pad
Memory foam wrist rest 
  hide details  
Reply
post #2 of 7
If you close it and open it again has the new text been saved or is it gone?
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
post #3 of 7
Thread Starter 
Quote:
Originally Posted by rabidgnome229 View Post
If you close it and open it again has the new text been saved or is it gone?
New stuff is gone.
    
CPUMotherboardGraphicsRAM
E6420 L644G @ stock Asus P5N-e SLI w/ BIOS 13.01 eVGA G80 GTS 320MB @ stock 2GB GEIL PC6400 @ stock 
Hard DriveOptical DriveOSMonitor
Seagate 320GB 7200.10 SATA 3Gb/s & WD 200GB IDE Lite-On Dual Layer DVD burner Windows 7 RC 32bit Gateway FPD2275W 22" @ 1680x1050 
KeyboardPowerCaseMouse
ativa micro Thermaltake Purepower RX 600W, 48A [TBD] w/ 2x 12cm 133cfm Ultra Kazes & 12cm S-Flex MX518 
Mouse Pad
Memory foam wrist rest 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
E6420 L644G @ stock Asus P5N-e SLI w/ BIOS 13.01 eVGA G80 GTS 320MB @ stock 2GB GEIL PC6400 @ stock 
Hard DriveOptical DriveOSMonitor
Seagate 320GB 7200.10 SATA 3Gb/s & WD 200GB IDE Lite-On Dual Layer DVD burner Windows 7 RC 32bit Gateway FPD2275W 22" @ 1680x1050 
KeyboardPowerCaseMouse
ativa micro Thermaltake Purepower RX 600W, 48A [TBD] w/ 2x 12cm 133cfm Ultra Kazes & 12cm S-Flex MX518 
Mouse Pad
Memory foam wrist rest 
  hide details  
Reply
post #4 of 7
Are the permissions right? You may have write protected the file

**EDIT**
Just saw the unix noob part
Type 'ls -l' in the directory in which the file is located to view the permissions
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
post #5 of 7
Thread Starter 
Quote:
Originally Posted by rabidgnome229 View Post
Are the permissions right? You may have write protected the file

**EDIT**
Just saw the unix noob part
Type 'ls -l' in the directory in which the file is located to view the permissions
I set the permissions in the terminal before running the script:
$chmod +x [script name here]

Is that wrong?
    
CPUMotherboardGraphicsRAM
E6420 L644G @ stock Asus P5N-e SLI w/ BIOS 13.01 eVGA G80 GTS 320MB @ stock 2GB GEIL PC6400 @ stock 
Hard DriveOptical DriveOSMonitor
Seagate 320GB 7200.10 SATA 3Gb/s & WD 200GB IDE Lite-On Dual Layer DVD burner Windows 7 RC 32bit Gateway FPD2275W 22" @ 1680x1050 
KeyboardPowerCaseMouse
ativa micro Thermaltake Purepower RX 600W, 48A [TBD] w/ 2x 12cm 133cfm Ultra Kazes & 12cm S-Flex MX518 
Mouse Pad
Memory foam wrist rest 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
E6420 L644G @ stock Asus P5N-e SLI w/ BIOS 13.01 eVGA G80 GTS 320MB @ stock 2GB GEIL PC6400 @ stock 
Hard DriveOptical DriveOSMonitor
Seagate 320GB 7200.10 SATA 3Gb/s & WD 200GB IDE Lite-On Dual Layer DVD burner Windows 7 RC 32bit Gateway FPD2275W 22" @ 1680x1050 
KeyboardPowerCaseMouse
ativa micro Thermaltake Purepower RX 600W, 48A [TBD] w/ 2x 12cm 133cfm Ultra Kazes & 12cm S-Flex MX518 
Mouse Pad
Memory foam wrist rest 
  hide details  
Reply
post #6 of 7
Quote:
Originally Posted by Starscream View Post
I set the permissions in the terminal before running the script:
$chmod +x [script name here]

Is that wrong?
There are three types of permissions, read, write, and executable. That command sets executable rights - the others may be off. What does 'ls -l' output?
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
post #7 of 7
Thread Starter 
Quote:
Originally Posted by rabidgnome229 View Post
There are three types of permissions, read, write, and executable. That command sets executable rights - the others may be off. What does 'ls -l' output?
-rwxrwxr-x
testscript (the file's name)
    
CPUMotherboardGraphicsRAM
E6420 L644G @ stock Asus P5N-e SLI w/ BIOS 13.01 eVGA G80 GTS 320MB @ stock 2GB GEIL PC6400 @ stock 
Hard DriveOptical DriveOSMonitor
Seagate 320GB 7200.10 SATA 3Gb/s & WD 200GB IDE Lite-On Dual Layer DVD burner Windows 7 RC 32bit Gateway FPD2275W 22" @ 1680x1050 
KeyboardPowerCaseMouse
ativa micro Thermaltake Purepower RX 600W, 48A [TBD] w/ 2x 12cm 133cfm Ultra Kazes & 12cm S-Flex MX518 
Mouse Pad
Memory foam wrist rest 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
E6420 L644G @ stock Asus P5N-e SLI w/ BIOS 13.01 eVGA G80 GTS 320MB @ stock 2GB GEIL PC6400 @ stock 
Hard DriveOptical DriveOSMonitor
Seagate 320GB 7200.10 SATA 3Gb/s & WD 200GB IDE Lite-On Dual Layer DVD burner Windows 7 RC 32bit Gateway FPD2275W 22" @ 1680x1050 
KeyboardPowerCaseMouse
ativa micro Thermaltake Purepower RX 600W, 48A [TBD] w/ 2x 12cm 133cfm Ultra Kazes & 12cm S-Flex MX518 
Mouse Pad
Memory foam wrist rest 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › [Bash] My script won't update. Help.