10-30-2007
Quote:
Originally Posted by
adgarg
var=a$i
You'll need to play around with eval or similar to expand what you are trying to do, I'm guessing here, but something like "eval \$a$i"
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Now, am in a very tight situation here. I really dont expect anyone to understand but please, try your best.
am trying to right a program that goes back to the previous entry to correct a mistake.
heres what am trying to do. i write a program like this
Name : James Holgston... (1 Reply)
Discussion started by: TRUEST
1 Replies
2. Shell Programming and Scripting
Hellow every body
I am trying to write a very simple script in an executable file as following
if ($?PWD) then
echo "OK"
else
echo "No"
endif
but I am getting error during execution in c shell as
synthax error at line 4 , unexpected end of file
Please advise (2 Replies)
Discussion started by: Reza Nazarian
2 Replies
3. Programming
I am programming the following simple shell program. It works for the most part, things like 'ls' and 'ps' work just fine. However when I add options, (example, ls -l) it does not execute the command. Also, I've been trying to add an "exit" command, so that I don't have to use the iterrupt; but... (3 Replies)
Discussion started by: TexasGuy
3 Replies
4. Shell Programming and Scripting
How to write a shell script which takes 3 strings as positional parameters,first and second are file names and third is a directory.if the two files exist in `pwd` and they contain a specific pattern and their size is greater than 32 bytes,moves these files into directory? (1 Reply)
Discussion started by: rameshparsa
1 Replies
5. Shell Programming and Scripting
hello,
i have problem in awk filter in shell to concatenate two string
plz send me a solution as soon as possible
from
jyoti ardeshana (4 Replies)
Discussion started by: jyotiardeshana
4 Replies
6. Shell Programming and Scripting
in the beginners book i have it gives an exercise to try. saying to make a script that examines the time. it should keep examining every second or so and say some sort of message. Can anyone help me get going.
Thanks (3 Replies)
Discussion started by: bebop1111116
3 Replies
7. Shell Programming and Scripting
Iam having file 1 as
wc -l file1 is 8
QWEERTYUU|7927836357398398398913 yuyuyu uyiuyuyuyuy yuiyuiyuyuyy
FDHGFSHAJK|1476887897877777777771 iopwiiwpoi e
.
.
.
.
I Need to read the abouve line in file1
so iam using the command as
tail -n 8... (8 Replies)
Discussion started by: nivas
8 Replies
8. Shell Programming and Scripting
Hi all,
I am trying to get a file from an ftp server and i have the list of files which needs to be get from the ftp server.
grep unix_prg*.* log.txt > log1.txt
log1.txt (which has the list of files)
06-29-09 00:00AM 3550258 unix_prg090629
06-28-09 07:00PM ... (7 Replies)
Discussion started by: raghav1982
7 Replies
9. Homework & Coursework Questions
Hi all,
I have an assignment from school to write a shell program in linux. the idea is to exercise fork() and execv() functions.. the shell program is supposed to be the master and every command that the user prints will run in a new process. we also need to try running the command in every... (1 Reply)
Discussion started by: r3vive
1 Replies
10. Homework & Coursework Questions
1. I've have to write a shell program that accepts Ctrl+T (in linux os in c language) and should print out the current time and date to the screen. I've written the following code but i've to type ^T individual rather than pressing ctrl+T(^T) to get the output. :
2. How do i make the shell... (2 Replies)
Discussion started by: zorro_phu
2 Replies
LEARN ABOUT CENTOS
losetup
LOSETUP(8) System Administration LOSETUP(8)
NAME
losetup - set up and control loop devices
SYNOPSIS
Get info:
losetup loopdev
losetup -l [-a]
losetup -j file [-o offset]
Delete loop:
losetup -d loopdev...
Delete all used loop devices:
losetup -D
Print name of first unused loop device:
losetup -f
Setup loop device:
losetup [-o offset] [--sizelimit size]
[-p pfd] [-rP] {-f[--show]|loopdev} file
Resize loop device:
losetup -c loopdev
DESCRIPTION
losetup is used to associate loop devices with regular files or block devices, to detach loop devices and to query the status of a loop
device. If only the loopdev argument is given, the status of the corresponding loop device is shown.
Note that the old output format (e.g. losetup -a) with comma delimited strings is deprecated in favour of the --list output format (e.g.
losetup -a -l).
OPTIONS
+The size and offset arguments may be followed by the multiplicative +suffixes KiB=1024, MiB=1024*1024, and so on for GiB, TiB, PiB, EiB,
ZiB and YiB +(the "iB" is optional, e.g. "K" has the same meaning as "KiB") or the suffixes +KB=1000, MB=1000*1000, and so on for GB, TB,
PB, EB, ZB and YB.
-a, --all
show status of all loop devices. Note that not all information are accessible for non-root users. See also --list. The old output
format (as printed without --list) is deprecated.
-c, --set-capacity loopdev
force loop driver to reread size of the file associated with the specified loop device
-d, --detach loopdev...
detach the file or device associated with the specified loop device(s)
-D, --detach-all
detach all associated loop devices
-f, --find
find the first unused loop device. If a file argument is present, use this device. Otherwise, print its name
-h, --help
print help
-j, --associated file
show status of all loop devices associated with given file
-l, --list
if a loop device or the -a option is specified, print default columns for either the specified loop device or all loop devices,
default is to print info about all devices.
-o, --offset offset
the data start is moved offset bytes into the specified file or device
-O, --output columns
specify which columns are to be printed for the --list output
--sizelimit size
the data end is set to no more than size bytes after the data start
-P, --partscan
force kernel to scan partition table on newly created loop device
-r, --read-only
setup read-only loop device
--show print device name if the -f option and a file argument are present.
-v, --verbose
verbose mode
ENCRYPTION
Cryptoloop is no longer supported in favor of dm-crypt. For more details see cryptsetup(8).
RETURN VALUE
losetup returns 0 on success, nonzero on failure. When losetup displays the status of a loop device, it returns 1 if the device is not con-
figured and 2 if an error occurred which prevented from determining the status of the device.
FILES
/dev/loop[0..N]
loop block devices
/dev/loop-cotrol
loop control device
EXAMPLE
The following commands can be used as an example of using the loop device.
# dd if=/dev/zero of=~/file.img bs=1MiB count=10
# losetup --find --show ~/file.img
/dev/loop0
# mkfs -t ext2 /dev/loop0
# mount /dev/loop0 /mnt
...
# umount /dev/loop0
# losetup --detach /dev/loop0
AUTHORS
Karel Zak <kzak@redhat.com>, based on original version from Theodore Ts'o <tytso@athena.mit.edu>
AVAILABILITY
The losetup command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
util-linux July 2003 LOSETUP(8)