I keep getting this error when I try to install anything on my computer$ sudo apt-get install -y lm-sensorsReading package lists...
Building dependency tree...
Reading state information...
lm-sensors is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 270 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setti
I'm writing a script and I discovered some unexpected behaviour of uninitialized and unset array variables that I do not understand.
First of all, the length:
giacomo@jack-laptop:~$ echo ${#notset[@]}
0
giacomo@jack-laptop:~$ uninitialized=
giacomo@jack-laptop:~$ echo ${#uninitialized[@]}
1
Why is the uninitialized length 1? Shouldn't it be zero?
Xyne wrote:The "$hour" and "$mins" variables of that line are parsed from the output of the following command:last -x | grep shutdown | head -1The next time that you notice the error message, run that command in a terminal and post the output here.
hey all,
I have this code :
Code:
#!/bin/tcsh -f
set line=($<)
while($#line > 0)
echo $line[1]
set line=($<)
end
the usage to run the script would be :
Code:
./file < file2
Is there a way to specify filename in the script itself instead of getting/reading file name from STDIN ?
Using :
Code:
set file=data
instead of :
Code:
set line=($&
Hello experts,
I have two files which I'm uploading.
I would like to write a script that takes something like this:
Line 1
Line 2
Line 3
Line 4
[Blank line]
Line 6
Line 7
Line 8
Line 9
[Blank line]
etc....
And makes it to look like this:
Line 1|Line 2|Line 3|Line 4|[Blank line, if it's easier]
Line 6|Line 7|Line 8|Line 9|[Blank line, if it's easier]
etc.
I would think it would be fairly easy to use two loops, one for the the 5-li
I need a script to take the filename of every file in a directory and substitute that file name for whatever is on the first line of the file. There may or may not be anything on the line, but I want the line to be the same as the file name. Most of the script tools I have used are non-destructuve, so I'm not sure how to go about this.
Hi,
I'm trying to read a line and the next line in a shell script by executing the following code:
Code:
for i in `seq 1 $numLines`; do
line=$(sed -n '{$i}p' outputFile)
echo $line
done
$numLines contanis the outputFile's number of lines.
It doesn't work and I cannot use a while loop because I need to reed $(i+1) line after $i line.
I am trying to read user and server details from file tempo.txt and then check the disk space usage of the file system on that unix account using another script server_disk_space.sh.But I am not able to figure out why while loop is only working for first line and for loop is working fine.Please help me understand this.
Using while loop
#!/usr/bin/ksh
while read line
do
r1=`echo $line | cut -d"