Hi all,
First of all compliments on the forum here. Looks great and has lots of information, some of which I have been able to use. I am a relativ noob when it comes to Unix but already I have been fooling around with scripts for the company I work for here in switzerland!
Thanks to this forum I created following script:
works great so far. the only problem I have is that when the user makes a choice (1,2 or 3 i would like a text to come that basically says: The email address you chose was: david.t@bluewin.ch
In the case I put in >&1 which results in that I quickly see it on the screen but with the loop it is imediatly cleared again. If this was vba I would have no problem but this kinda scripting is new to me!
Or perhaps I am going about this completly wrong. The end result should be that the user makes a choice and his email address gets written into a text file which is later used in another script to define who an email is sent to.
So I would greatly appreciate it if someone could help me
while [ $choice -ne 4 ]
do
clear
echo "Bitte Email-adresse von Liste wählen:"
echo ""
echo "1) urs.betscha@rhenus.ch"
echo "2) michael.jucker@rhenus.ch"
echo "3) david.temperli@rhenus.ch"
echo ""
echo "4) Programm beenden!"
echo ""
echo " Welche Email-adresse? \c"
read choice
case "$choice" in 1 ) email="urs.bet@rhe.ch";;
2 ) email="michael.jur@rhe.ch" ;;
3 ) email="david.te@rhe.ch" ;;
4 ) clear; exit 1 ;;
esac echo "The id you selected is $email_id"
echo "$email_id" >> $email
echo "Press a key\c"
read x #just to wait for you to press enter
done
Is there a way I can specify the name of a list as an argument to a shell script and then use the values of that list name in the script?
I need to do this WITHOUT using case statements.
Something like this:
check.sh list1
#!/bin/bash
list1="www.amazon.com www.google.com"... (9 Replies)
For etc, I have 3 files in /testing folder
apple.sh
orange.sh
pear.sh
if I want to find out the apple.sh
It easy, I can type
ls -ltr *apple*
Expected result:
apple.sh
but, the problem is coming up from my mind. How can I find the others .sh files without the file name "apple.sh"?
... (2 Replies)
I am trying to test some operations on a directed list. However, the declaration of a pointer is giving me trouble.
I seem to have done something incorrectly because I get an error:
"listtest.c:29: warning: 'p' may be used uninitialized in this function"
Can anyone help?
This is my code... (6 Replies)
I have a huge set of files (with extension .common) in my directory around 2 million. When I run this script on my Linux with BASH, I get /bin/awk: Argument list too long
awk -F'\t' '
NR == FNR { a=NR }
NR != FNR {
sub(".common", "", FILENAME)
print a, FILENAME, $1
}
'... (1 Reply)
I've made a habit of including a four-letter "tail" on image file names I download from the Web, so I can both match them with IPTC Transmission References of my own making and rename them later using either a GUI renamer or a script I've written myself. Now I want to automate the process of... (2 Replies)
I am trying to take a list of directories in a folder and give them a variable name. I have this working with the exception that the shell_exec command wants to place a return. Here is my code which might explain better what I am trying to do:
<?php
session_start();
$student1=$_SESSION;... (0 Replies)
I got a long list of file name.
My input:
data_1.txt
data_2.txt
data_3.txt
data_10.txt
data_21.txt
data_12.txt
data_4.txt
My desired output:
data_1.txt
data_2.txt
data_3.txt
data_4.txt
data_10.txt
data_12.txt
data_21.txt
Does anybody got idea how to archive it? (11 Replies)
Hi, I'm having difficulty in making a bash script to get netcat to scan a list of hosts and their ports from another file and could use some help. Here's an example host list, "nc.host":
192.168.2.110 22
And here's the first script I tried to feed "nc.host" into netcat:
"nc1.sh"
... (3 Replies)
When I do a file list in my spooler directory, I get the following
information
#ls -l |pg
-rw-rw-rw- 1 user1 ugroups 831690 Apr 03 12:52 K6A80403125051.prn :res 2330479869879093344 ext 2330477052380546512 align
-rw-rw-rw- 1 user1 ugroups 5900 Apr 03 14:19 K6A80403141858.idx :res... (8 Replies)