Originally Posted by
Lars Noodén
I've tried a few ways but it looks like you have to have script call your shell script. Try using the -c option with script.
yes it worked... Thank you
but why doesn't it worked before?? what's wrong?
and the script itself is not exiting even if i entered exit command in shell script why so?
i will post my code and the Output it gave me..
Code:
#!/bin/bash
script -c testscript
echo "The Kernal Version is"
uname -a
echo "The Distribution Version is"
lsb_release -a
echo "The Partition Sizes are "
cat /proc/partitions
exit
echo " So far what the script does is"
less testscript
exit
The OUTPUT is
Code:
krishna@ubuntu:~/Desktop/Samples$ sh envcheck.sh
Script started, file is typescript
bash: testscript: command not found
Script done, file is typescript
The Kernal Version is
Linux ubuntu 3.2.0-33-generic-pae #52-Ubuntu SMP Thu Oct 18 16:39:21 UTC 2012 i686 i686 i386 GNU/Linux
The Distribution Version is
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.1 LTS
Release: 12.04
Codename: precise
The Partition Sizes are
major minor #blocks name
7 0 30457856 loop0
8 0 312571224 sda
8 1 51407968 sda1
8 2 1 sda2
8 5 130584321 sda5
8 6 130576288 sda6
8 16 3956736 sdb
It is not working right it's closing immediately after starting.. what should i do??
it has to display again
Bookmarks