Search Results

Search: Posts Made By: Chubler_XL
11,508
Posted By Chubler_XL
EXPORT allows shell variables to be passed onto...
EXPORT allows shell variables to be passed onto sub processes of the current shell not back up to the calling process.

If you want a child script to set environment variables in the parent...
7,027
Posted By Chubler_XL
Your RE is matching the local echo of hostname...
Your RE is matching the local echo of hostname -i\r sent earlier. Try this RE .*\r\n(.*)\r\n#

For example:
set timeout 3
log_user 0
expect "# " {send "hostname -i\r"}
expect {
-re...
112,157
Posted By Chubler_XL
I do remember you being quite concerned with...
I do remember you being quite concerned with performance in this SWARM stuff and I would have thought the bash =~ operator could be use in place of grep.

$ export NUM='[['
$ time bash -c 'echo...
5,561
Posted By Chubler_XL
In general you would use VAR=$( command ) to...
In general you would use VAR=$( command ) to capture the output of each command and then echo your result at the end like this:

#!/bin/bash

if [ $# -eq 1 ]
then
filename="/home/marco/$1"...
63,316
Posted By Chubler_XL
Perhaps I'm misinterpreting your request but...
Perhaps I'm misinterpreting your request but would this suffice?

. ./file.txt
echo "a[1] = ${a[1]} a[2] = ${a[2]} a[3] = ${a[3]}"
echo "b[1] = ${b[1]} b[2] = ${b[2]} b[3] = ${b[3]}"
echo...
69,159
Posted By Chubler_XL
<( list ) (process substitution) not available...
<( list ) (process substitution) not available is sh, your first example was probably using bash to run the script.

You could try this instead:

col_list='{print $64,$64,$52,$64,$64,$33}'
tail...
8,508
Posted By Chubler_XL
1. In StartProcess.sh you only set an environment...
1. In StartProcess.sh you only set an environment variable and echo a couple of messages. $! is supposed to be the PID of the last command run in the background, but nothing is being run in the...
78,475
Posted By Chubler_XL
Apologies, I forgot to set $num in my example: ...
Apologies, I forgot to set $num in my example:

$ text='QIl reçoit 5 000 $ à la livraison. 5 000 $?'
$ num=1
$ echo '((1)) ((2))' > temp.tmp
$ perl -i -CA -pne 'my $val='\'"${text}"\'';...
5,698
Posted By Chubler_XL
You could write a script that asks and then...
You could write a script that asks and then executes /bin/crontab. Put this in the PATH before /bin (eg /usr/local/bin):

Script could be something like this as an example. You may not want to...
78,475
Posted By Chubler_XL
I found the problem with the perl code $ is...
I found the problem with the perl code $ is expanded in perl RE to avoid this I put the string in a perl variable with single quotes around it like this:

$ text='QIl reçoit 5 000 $ à la livraison....
16,934
Posted By Chubler_XL
Try setting PATH to a reasonable value at the top...
Try setting PATH to a reasonable value at the top of that script. Cron does not execute /etc/profile or other login scripts so PATH is likely to be unset then the script is failing to find external...
16,934
Posted By Chubler_XL
What is the contents of the script then?
What is the contents of the script then?
4,141
Posted By Chubler_XL
If they are directories in your filesystem you...
If they are directories in your filesystem you could try:

$ cd /PPC/Cloud_Automation/Applications/APPNAME/Files
$ find . -type d -print
.
./Data Management
./Data Management/Data
./Essbase...
16,934
Posted By Chubler_XL
A issue I see a lot with cron is that the...
A issue I see a lot with cron is that the environment is not set as it is during a normal login. Particularly the PATH environment variable.

With your particular script I'm guessing that...
10,647
Posted By Chubler_XL
Using tcsh version 6.22.01, with no matching...
Using tcsh version 6.22.01, with no matching files the script appears to be working correctly:

$ ./odensun
find: No match.
find: No match.
No zip files found.
No tar files found.

I suspect...
10,647
Posted By Chubler_XL
Have you considered using another shell? See: ...
Have you considered using another shell? See:

Top Ten Reasons not to use the C shell (http://www.grymoire.com/Unix/CshTop10.txt)
Csh problems (http://www.grymoire.com/Unix/Csh.html#uh-0)
Csh...
16,934
Posted By Chubler_XL
Have you considered inotifywait(1)...
Have you considered inotifywait(1) (https://www.unix.com/man-page/debian/1/inotifywait/) provided by the inotify-tools package on some distributions, this can run your script whenever a file appears...
8,571
Posted By Chubler_XL
This is working as expected in bash 4.4.12 $...
This is working as expected in bash 4.4.12

$ var="/etc/tomcat/server.xml /etc/tomcat/test/server.xml"
$ var2=( $var )
$ echo ${var2[0]}
/etc/tomcat/server.xml
$ echo ${var2[1]}...
62,583
Posted By Chubler_XL
Nice procedure nezabudka, but original request...
Nice procedure nezabudka, but original request was selection of item by number or by name:



For a higher level of difficulty how about spaces in the options:

#!/bin/bash
listofitems="fried...
62,583
Posted By Chubler_XL
How about this using the shell select internal ...
How about this using the shell select internal

listofitems="beans rice carrots radishes rutabaga spinach"
MU=( $listofitems Quit )

while true
do
echo "Please enter the veg you like from"...
2,838
Posted By Chubler_XL
I have had some success with prompting for the...
I have had some success with prompting for the password (without username) from sudo like this:

$ cat /usr/local/bin/zenity_passphrase
#!/bin/bash
zenity --password --title="sudo password...
17,716
Posted By Chubler_XL
Do the commands realpath or readlink (with or...
Do the commands realpath or readlink (with or without -f) help here at all?

Or perhaps the Cwd module from perl:
perl -MCwd -e 'print Cwd::realpath($ARGV[0])' /home/user_name
13,270
Posted By Chubler_XL
Sorry about my delay in gettng back think...
Sorry about my delay in gettng back think timezone differences are involved here. looks like we have some nice solutions coming together in this thread now.

This is the pseudo code I had in mind...
13,270
Posted By Chubler_XL
I can understand that the specifics of what...
I can understand that the specifics of what particular tool or language require knowledge you may not have.

How about trying to give us some pseudo code for how this file should be processed.
...
13,270
Posted By Chubler_XL
This forum is not a script writing service. ...
This forum is not a script writing service.

If you have a solution you have worked on that is not complete we can help you, but you must have shown some effort to solve this yourself.
Showing results 1 to 25 of 500

 
All times are GMT -4. The time now is 08:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy