10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have put a script inside bash_profile of user "root". That script executes when we do "sudo su -" and prompts with a question : "Why are you logginf as root?" and users have to pass the reason then they get prompt. Inside script we have used "read -p input" to take input from user.
I am a... (3 Replies)
Discussion started by: shekhar_4_u
3 Replies
2. Shell Programming and Scripting
I have a script that looks like this:sed -f myfile.sed $1 > $1.out called myscript and would like to change it so the parameter isn't necessary: ls *.idx | myscript | xargs some_command What do I need to add so it can run either way?
TIA
---------- Post updated at 09:41 AM ----------... (1 Reply)
Discussion started by: wbport
1 Replies
3. UNIX for Beginners Questions & Answers
Say I had an extremely simple script called testScript.sh:
#!/bin/sh
echo $1
and I invoked it as:
source testScript.sh <<< x
or
source testScript.sh <<< inputFile.txt
When I do the above the values don't appear in the echo statement, and I know that is because in the echo... (5 Replies)
Discussion started by: steezuschrist96
5 Replies
4. Shell Programming and Scripting
I'm trying to automatically pass user input values into a script that is being called from another script, below is my current script and I added a comment next to the script where it asks user to enter input value.
Thanks,
mbak
#!/bin/ksh
echo " Adding disks for DB server then Enter YES... (2 Replies)
Discussion started by: mbak
2 Replies
5. Shell Programming and Scripting
script:
while read inputline; do
if ; then
if ; then
break
fi
fi
done
Looks like the script hangs when stdin is empty or contains space. Any ideas on how to circumvent this? is it possible to use getline to process stdin content? (4 Replies)
Discussion started by: ux4me
4 Replies
6. Shell Programming and Scripting
Good morning!!
I wrote a script and Im not the best at Perl so I would like someone to look it over....just in case. Ive been working on this script forever!!
The script is supposed to: Have the user enter a number using STDIN. Calculate the average of the numbers, the total of all of the... (0 Replies)
Discussion started by: bigben1220
0 Replies
7. Shell Programming and Scripting
Running on AIX 5.3L.
I have a program "foo" written in Fortran that requires 3 levels of inputs from stdin (command prompt).
> foo
Enter Input 1: a
Enter Input 2: b
Enter Input 3: c
running foo
success!
>
How do I get a shell script to run this automatically?
> echo "a" | foo... (2 Replies)
Discussion started by: discoganya
2 Replies
8. Shell Programming and Scripting
Hello,
I've managed to get my .procmailrc file to work. At least it triggers a script which creates a file. But the file is empty. How do I get at the data that's been piped? I've done much creative googling to no avail. I belive it should be in stdin, but I can't figure out how to access... (4 Replies)
Discussion started by: mmesford
4 Replies
9. Shell Programming and Scripting
I am unable to use STDIn redirection with < (commands)
When I do the following, both approaches work and give the same results:
1.
$ printf "aaa\nbbb\n" > file1
$ printf "111\n222\n" > file2
$ cat file1 file2
aaa
bbb
111
2222.
$ cat <(printf "aaa\nbbb\n") <(printf "111\n222\n")
aaa... (8 Replies)
Discussion started by: metaltree
8 Replies
10. Programming
Hi
I am doing file redirection at console for use by my binary.
%console%> bin < inputfile
After reading in the entire file, I want my program to continue taking input from the console. So essentially I want to redirect stdin back to console. But I cant figure out how to do it.
I am... (4 Replies)
Discussion started by: nauman
4 Replies