User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Perl section within the Software Development category of DaniWeb, a massive community of 402,751 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,440 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Perl advertiser: Programming Forums
Views: 7374 | Replies: 1
Reply
Join Date: Oct 2004
Posts: 57
Reputation: satimis is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
satimis satimis is offline Offline
Junior Poster in Training

A simple perl script

  #1  
Aug 13th, 2005
Hi folks,

I'm prepared to write a simple perl scripts as follow

There are 25 commands executed in following sequence
export LFS=/mnt/lfs
mount /dev/hda6 /mnt/lfs
mkdir -p $LFS
echo $LFS
/mnt/lfs (output)
/usr/sbin/chroot "$LFS" /tools/bin/env -i HOME=/root TERM="$TERM" PS1='\u:\w\$ '     PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin /tools/bin/bash --login +h
mknod -m 600 /dev/console c 5 1
mknod -m 666 /dev/null c 1 3
mount -n -t tmpfs none /dev
mknod -m 622 /dev/console c 5 1
mknod -m 666 /dev/null c 1 3
mknod -m 666 /dev/zero c 1 5
mknod -m 666 /dev/ptmx c 5 2
mknod -m 666 /dev/tty c 5 0
mknod -m 444 /dev/random c 1 8
mknod -m 444 /dev/urandom c 1 9
chown root:tty /dev/{console,ptmx,tty}
ln -s /proc/self/fd /dev/fd
ln -s /proc/self/fd/0 /dev/stdin
ln -s /proc/self/fd/1 /dev/stdout
ln -s /proc/self/fd/2 /dev/stderr
ln -s /proc/kcore /dev/core
mkdir /dev/pts
mkdir /dev/shm
mount -t devpts -o gid=4,mode=620 none /dev/pts
mount -t tmpfs none /dev/shm


In normal circumstance there is no output on all commands except command-4 with "/mnt/lfs" as output. If not considering the output it will be quite simple just listing all commands on a shell script. Now I expect to arrange the script as follows;

1) The script will automatically continue to execute command-5 if the output of command-4 is "/mnt/lfs" otherwise exit the shell.
2) If there is an output on any command it needs to confirm "yes/no" with the corresponding command displayed on the terminal. 'yes" will continue on next command. "no" will exit the shell stopping the script.

I'm considering whether shell script or perl script will do the job better. If perl script then how to start. Which module/modules will be more appropriate, TIA

B.R.
satimis
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2005
Posts: 11
Reputation: mforeman is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
mforeman mforeman is offline Offline
Newbie Poster

Help trying to expand a bus in a file in PERL or UNIX

  #2  
Dec 7th, 2005
I am trying to list out a bus as individual names.

For instance - When I come across a section in a file that lists a bus like this:

[0:2] <busname>

I would like to print out this:

<busname>[0]
<busname>[1]
<busname>[2]

Any ideas in PERL or UNIX would be appreciated.

Thanks
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Perl Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Perl Forum

All times are GMT -4. The time now is 8:18 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC